2021-06-08 21:25:37 -05:00
|
|
|
console.log('(Info) Preparing to start!')
|
2021-02-11 21:39:01 -06:00
|
|
|
const fs = require('fs');
|
2021-06-08 21:25:37 -05:00
|
|
|
console.log('(Info) Loaded Filesystem successfully!')
|
2021-02-11 21:39:01 -06:00
|
|
|
const Discord = require('discord.js');
|
2021-06-08 21:25:37 -05:00
|
|
|
console.log('(Info) Loaded Discord successfully!')
|
2021-02-25 10:11:54 -06:00
|
|
|
const { build, release, prefix, token } = require('./config.json');
|
|
|
|
const { denied, error, info, success, warning } = require('./icons.json');
|
2021-02-11 21:39:01 -06:00
|
|
|
const os = require("os");
|
2021-06-08 21:25:37 -05:00
|
|
|
console.log('(Info) Loaded OS successfully!')
|
2021-02-25 10:11:54 -06:00
|
|
|
|
2021-02-11 21:39:01 -06:00
|
|
|
const activities_list = [
|
|
|
|
"with np!help",
|
2021-07-21 15:48:17 -05:00
|
|
|
"with Sophie!",
|
|
|
|
"Trans Rights!",
|
|
|
|
"in your computer",
|
|
|
|
"with my internet router",
|
|
|
|
"ssh: system64@borkeonv2",
|
|
|
|
"YouTube",
|
|
|
|
"with source code",
|
|
|
|
"Visual Studio Code"
|
2021-02-11 21:39:01 -06:00
|
|
|
];
|
|
|
|
|
|
|
|
console.log('Starting! This should only take a moment.')
|
|
|
|
const client = new Discord.Client();
|
|
|
|
client.commands = new Discord.Collection();
|
|
|
|
const footicon = "https://cdn.discordapp.com/attachments/803658122299572255/805506708352008232/system64.png"
|
2021-06-08 21:25:37 -05:00
|
|
|
const footer = "Made with ❤ in Illinois | Anitrox, by IDeletedSystem64"
|
2021-02-11 21:39:01 -06:00
|
|
|
|
|
|
|
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
|
|
|
|
|
|
|
|
for (const file of commandFiles) {
|
|
|
|
const command = require(`./commands/${file}`);
|
|
|
|
client.commands.set(command.name, command);
|
|
|
|
}
|
|
|
|
|
|
|
|
client.on("error", (e) => console.error(e));
|
|
|
|
client.on("warn", (e) => console.warn(e));
|
|
|
|
|
|
|
|
client.once('ready', () => {
|
|
|
|
console.clear()
|
|
|
|
console.log(' ___ _ __ ');
|
|
|
|
console.log(' / | ____ (_) /__________ _ __');
|
|
|
|
console.log(' / /| | / __ \/ / __/ ___/ __ \| |/_/');
|
|
|
|
console.log(' / ___ |/ / / / / /_/ / / /_/ /> < ');
|
|
|
|
console.log('/_/ |_/_/ /_/_/\__/_/ \____/_/|_| ')
|
2021-06-08 21:25:37 -05:00
|
|
|
console.log(release + ", " + build)
|
|
|
|
console.log("All Systems Go. | Anitrox by IDeletedSystem64 | We're now open-source! Check it out at bit.ly/anitroxsource");
|
2021-02-11 21:39:01 -06:00
|
|
|
});
|
|
|
|
setInterval(() => {
|
|
|
|
const index = Math.floor(Math.random() * (activities_list.length - 1) + 1);
|
|
|
|
client.user.setActivity(activities_list[index]);
|
|
|
|
}, 20000);
|
|
|
|
|
|
|
|
client.on('message', message => {
|
|
|
|
if (!message.content.startsWith(prefix) || message.author.bot) return;
|
|
|
|
|
|
|
|
const args = message.content.slice(prefix.length).split(/ +/);
|
|
|
|
const command = args.shift().toLowerCase();
|
|
|
|
|
|
|
|
if (!client.commands.has(command)) return;
|
|
|
|
|
|
|
|
try {
|
2021-03-16 17:09:00 -05:00
|
|
|
client.commands.get(command).execute(client, message, args, Discord);
|
2021-02-11 21:39:01 -06:00
|
|
|
} catch (error) {
|
2021-06-08 21:25:37 -05:00
|
|
|
console.stack
|
2021-02-11 21:39:01 -06:00
|
|
|
const embed = {
|
2021-03-16 17:09:00 -05:00
|
|
|
"title": "<:AnitroxError:809651936563429416> **Well that happened...**",
|
2021-02-11 21:39:01 -06:00
|
|
|
"color": 13632027,
|
|
|
|
"footer": {
|
|
|
|
"icon_url": "https://cdn.discordapp.com/attachments/549707869138714635/793524910172667964/Screenshot_26.png",
|
2021-06-08 21:25:37 -05:00
|
|
|
"text": footer
|
2021-02-11 21:39:01 -06:00
|
|
|
},
|
|
|
|
"fields": [
|
|
|
|
{
|
|
|
|
"name": "**What Happened?**",
|
|
|
|
"value": "The command you tried to run failed to execute due to an error."
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Error Info",
|
2021-03-16 17:09:00 -05:00
|
|
|
"value": error.stack
|
2021-02-11 21:39:01 -06:00
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
message.channel.send({ embed });
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
client.login(token);
|