Merge branch 'dev' of github.com:IDeletedSystem64/anitrox into dev
This commit is contained in:
commit
752e6728bb
|
@ -1,47 +1,27 @@
|
|||
const answers = [
|
||||
"Heck no!",
|
||||
"Are you crazy!? No!",
|
||||
"Don't even think about it.",
|
||||
"No! You might bork something!",
|
||||
"Heck yeah",
|
||||
"I don't think so.",
|
||||
"Let me think about it first. No.",
|
||||
"Let me think about it first. Yeah",
|
||||
"Let me think about it first. Maybe",
|
||||
"I don't know man",
|
||||
"Maybe",
|
||||
"I'm not sure",
|
||||
"Ask again",
|
||||
"YEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE!!!",
|
||||
"Definitely!",
|
||||
"Go for it! :smile:",
|
||||
"Good idea!",
|
||||
"Sure"
|
||||
]
|
||||
|
||||
module.exports = {
|
||||
name: '8ball',
|
||||
description: 'Ask Anitrox a question, any question! and they will answer it!',
|
||||
syntax: ["[Question]"],
|
||||
async execute(client, message, args, footerTxt) {
|
||||
const answer = answers[Math.floor(Math.random() * Object.keys(answers).length)];
|
||||
async execute(client, message, args, config) {
|
||||
const index = Math.floor(Math.random() * config.answers.length);
|
||||
const answer = config.answers[index]
|
||||
const question = args.slice(0).join(" ")
|
||||
|
||||
if (!question) {
|
||||
await message.channel.send(client.generateErrorMessage("You need to ask a question!", message.author.displayAvatarURL));
|
||||
} else {
|
||||
await message.channel.send({embed: {
|
||||
"title": ":8ball: Anitrox 8 Ball",
|
||||
"description": `Your question: **${question}**`,
|
||||
"title": ":8ball: 8Ball",
|
||||
"description": `Your amazing question: **${question}**`,
|
||||
"color": 9442302,
|
||||
"footer": {
|
||||
"icon_url": message.author.displayAvatarURL(),
|
||||
"text": footerTxt
|
||||
"text": config.footerTxt
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"name": "🤔 My Answer",
|
||||
"value": answer
|
||||
"name": "Answer",
|
||||
"value": `${answer}`
|
||||
}
|
||||
]
|
||||
}});
|
||||
|
|
|
@ -1,22 +1,21 @@
|
|||
const { inspect } = require("util");
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: 'eval',
|
||||
description: 'Runs js code',
|
||||
async execute(_, message, args, footerTxt) {
|
||||
if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) {
|
||||
name: 'eval',
|
||||
description: 'Executes JS code',
|
||||
async execute(_, message, args, config) {
|
||||
if (message.author.id == config.ownerID) {
|
||||
try {
|
||||
const code = args.join(" ");
|
||||
const evaled = inspect(eval(code));
|
||||
await message.channel.send(evaled, {code:"xl"});
|
||||
} catch (error) {
|
||||
await message.channel.send({embed: {
|
||||
"title": "<:NyabotError:697145462347661412> **Well that happened...**",
|
||||
"title": "<:AnitroxError:809651936563429416> **Something went wrong! **",
|
||||
"color": 13632027,
|
||||
"footer": {
|
||||
"icon_url": message.author.displayAvatarURL(),
|
||||
"text": footerTxt
|
||||
"text": config.footerTxt
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
|
|
|
@ -14,10 +14,10 @@ module.exports = {
|
|||
const minutes = parseInt((totalSeconds % 3600) / 60);
|
||||
const seconds = parseInt(totalSeconds % 60);
|
||||
|
||||
const daystring = days + (days === 1 ? "day" : "days");
|
||||
const hourstring = hours + (hours === 1 ? "day" : "days");
|
||||
const minutetring = minutes + (minutes === 1 ? "day" : "days");
|
||||
const secondstring = seconds + (seconds === 1 ? "day" : "days");
|
||||
const daystring = days + (days === 1 ? " day" : " days");
|
||||
const hourstring = hours + (hours === 1 ? " hour" : " hours");
|
||||
const minutetring = minutes + (minutes === 1 ? " minute" : " minutes");
|
||||
const secondstring = seconds + (seconds === 1 ? " second" : " seconds");
|
||||
|
||||
return `${daystring}**, **${hourstring}**, **${minutetring}**, **${secondstring}`;
|
||||
}
|
||||
|
|
|
@ -1,19 +1,17 @@
|
|||
const { locations } = require('../config.json');
|
||||
|
||||
module.exports = {
|
||||
name: "ping",
|
||||
description: "Gets bot ping",
|
||||
async execute(client, message, _, footerTxt) {
|
||||
const index = Math.floor(Math.random() * locations.length);
|
||||
const pingLocation = locations[index]
|
||||
async execute(client, message, args, config) {
|
||||
const index = Math.floor(Math.random() * config.locations.length);
|
||||
const location = config.locations[index]
|
||||
|
||||
await message.channel.send({embed:{
|
||||
"title": ":ping_pong: Ping",
|
||||
"description": `**Pong!** We pinged **${pingLocation}** and got ${client.ws.ping} ms.`,
|
||||
"description": `**Pong!** We pinged **${location}** and got ${client.ws.ping} ms.`,
|
||||
"color": 9442302,
|
||||
"footer": {
|
||||
"icon_url": message.author.displayAvatarURL(),
|
||||
"text": footerTxt
|
||||
"text": config.footerTxt
|
||||
}
|
||||
}});
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
module.exports = {
|
||||
name: 'reload',
|
||||
description: 'Reloads a command',
|
||||
async execute(client, message, args, footerTxt) {
|
||||
if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) {
|
||||
name: 'reload',
|
||||
description: 'Reloads a command',
|
||||
async execute(client, message, args, config) {
|
||||
if (message.author.id = config.ownerID) {
|
||||
if (!args.length) {
|
||||
await message.channel.send(client.generateErrorMessage("You forgot to provide anything to reload, you pillock",message.author.displayAvatarURL()));
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ module.exports = {
|
|||
try {
|
||||
const newCommand = require(`./${command.name}.js`);
|
||||
client.commands.set(newCommand.name, newCommand);
|
||||
await message.channel.send(`<:NyabotSuccess:697211376740859914> **Reloaded \`${command.name}\` successfully!**`);
|
||||
await message.channel.send(`<:AnitroxSuccess:809651936819019796> **Reloaded \`${command.name}\` successfully!**`);
|
||||
console.log(`User reloaded ${command.name}.`)
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
@ -30,7 +30,7 @@ module.exports = {
|
|||
|
||||
} else {
|
||||
message.channel.send({embed: {
|
||||
"title": "<:NyabotDenied:697145462565896194> **Access is denied**",
|
||||
"title": "<:AnitroxDenied:809651936642203668> **403 Forbidden**",
|
||||
"color": 13632027,
|
||||
"footer": {
|
||||
"icon_url": message.author.displayAvatarURL(),
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
module.exports = {
|
||||
name: "stop",
|
||||
description: "Stops the bot",
|
||||
async execute(client, message, _, footerTxt) {
|
||||
if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) {
|
||||
description: "IT'S TIME TO STOP!... the bot",
|
||||
async execute(client, message, config) {
|
||||
if (message.author.id == config.ownerID) {
|
||||
await message.channel.send({embed: {
|
||||
"title": "<a:AnitroxWorking:697147309531594843> **Shutting Down...**",
|
||||
"description": "See you next time!",
|
||||
"color": 9442302,
|
||||
"footer": {
|
||||
"icon_url": message.author.displayAvatarURL(),
|
||||
"text": footerTxt
|
||||
"text": config.footerTxt
|
||||
},
|
||||
}});
|
||||
client.destroy();
|
||||
console.log("The bot is shutting down! Bye bye!")
|
||||
process.exit();
|
||||
} else {
|
||||
await message.channel.send({embed: {
|
||||
"title": ":AnitroxDenied: Access Denied",
|
||||
"title": "<:AnitroxDenied:809651936642203668> 403 Forbidden",
|
||||
"description": "You need to be the bot owner to execute this command!",
|
||||
"color": 13632027,
|
||||
"footer": {
|
||||
"icon_url": message.author.displayAvatarURL(),
|
||||
"text": footerTxt
|
||||
"text": config.footerTxt
|
||||
},
|
||||
}});
|
||||
}
|
||||
|
|
|
@ -21,17 +21,37 @@
|
|||
"VLC Media Player",
|
||||
"Chromium"
|
||||
],
|
||||
"locations": [
|
||||
"Microsoft",
|
||||
"LinusTechTips",
|
||||
"Linus Torvalds",
|
||||
"borkeonv2",
|
||||
"Google",
|
||||
"192.168.1.1",
|
||||
"127.0.0.1",
|
||||
"Sophie's computer",
|
||||
"Mars",
|
||||
"Elon Musk",
|
||||
"TMC Software"
|
||||
"locations": [
|
||||
"Microsoft",
|
||||
"LinusTechTips",
|
||||
"Linus Torvalds",
|
||||
"borkeonv2",
|
||||
"Google",
|
||||
"192.168.1.1",
|
||||
"127.0.0.1",
|
||||
"Sophie's computer",
|
||||
"Mars",
|
||||
"Elon Musk",
|
||||
"TMC Software"
|
||||
],
|
||||
"answers": [
|
||||
"Heck no!",
|
||||
"Are you crazy!? No!",
|
||||
"Don't even think about it.",
|
||||
"No! You might bork something!",
|
||||
"Heck yeah",
|
||||
"I don't think so.",
|
||||
"Let me think about it first. No.",
|
||||
"Let me think about it first. Yeah",
|
||||
"Let me think about it first. Maybe",
|
||||
"I don't know man",
|
||||
"Maybe",
|
||||
"I'm not sure",
|
||||
"Ask again",
|
||||
"YEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE!!!",
|
||||
"Definitely!",
|
||||
"Go for it! :smile:",
|
||||
"Good idea!",
|
||||
"Sure"
|
||||
]
|
||||
}
|
67
start.js
67
start.js
|
@ -2,8 +2,8 @@
|
|||
|
||||
const fs = require('fs');
|
||||
const Discord = require('discord.js');
|
||||
const { statuses, build, release, prefix, token, footerTxt } = require('./config.json');
|
||||
|
||||
// const { statuses, build, release, prefix, token, footerTxt } = require('./config.json');
|
||||
const config = require('./config.json');
|
||||
console.log('Starting!')
|
||||
const client = new Discord.Client();
|
||||
client.commands = new Discord.Collection();
|
||||
|
@ -20,11 +20,11 @@ client.generateErrorMessage = (errorMsg, messageAuthorURL) => ({embed: {
|
|||
"color": 13632027,
|
||||
"footer": {
|
||||
"icon_url": messageAuthorURL,
|
||||
"text": footerTxt
|
||||
"text": config.footerTxt
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"name": "Well that happened...",
|
||||
"name": "Something went wrong!",
|
||||
"value": errorMsg
|
||||
}
|
||||
]
|
||||
|
@ -33,47 +33,48 @@ client.generateErrorMessage = (errorMsg, messageAuthorURL) => ({embed: {
|
|||
client.on("error", (e) => console.log(`[ERROR] ${error(e)}`));
|
||||
client.on("warn", (e) => (`[WARN] ${warn(e)}`));
|
||||
client.once('ready', () => {
|
||||
console.clear()
|
||||
console.log(' ___ _ __ ');
|
||||
console.log(' / | ____ (_) /__________ _ __');
|
||||
console.log(' / /| | / __ \\/ / __/ ___/ __ \\| |/_/');
|
||||
console.log(' / ___ |/ / / / / /_/ / / /_/ /> < ');
|
||||
console.log('/_/ |_/_/ /_/_/\\__/_/ \\____/_/|_| ');
|
||||
console.log(`${release}, ${build}`);
|
||||
console.log("All Systems Go. | Anitrox by IDeletedSystem64 | ALL MY CODE KEEPS BLOWING UP!");
|
||||
console.clear()
|
||||
console.log(' ___ _ __ ');
|
||||
console.log(' / | ____ (_) /__________ _ __');
|
||||
console.log(' / /| | / __ \\/ / __/ ___/ __ \\| |/_/');
|
||||
console.log(' / ___ |/ / / / / /_/ / / /_/ /> < ');
|
||||
console.log('/_/ |_/_/ /_/_/\\__/_/ \\____/_/|_| ');
|
||||
console.log(`${config.release}, ${config.build}`);
|
||||
console.log("Bot online. | Anitrox by IDeletedSystem64 | ALL MY CODE KEEPS BLOWING UP!");
|
||||
// Statuses
|
||||
setInterval(async () => {
|
||||
// Picks a status from the config file
|
||||
const index = Math.floor(Math.random() * config.statuses.length);
|
||||
await client.user.setActivity(config.statuses[index]);
|
||||
}, 20000);
|
||||
|
||||
});
|
||||
|
||||
|
||||
setInterval(async () => {
|
||||
// Picks a status from the config file
|
||||
const index = Math.floor(Math.random() * statuses.length);
|
||||
await client.user.setActivity(statuses[index]);
|
||||
}, 20000);
|
||||
|
||||
// Begin Command Handler
|
||||
client.on('message', async (message) => {
|
||||
|
||||
if (!message.content.startsWith(prefix) || message.author.bot) return;
|
||||
if (!message.content.startsWith(config.prefix) || message.author.bot) return;
|
||||
|
||||
const args = message.content.slice(prefix.length).split(/ +/);
|
||||
const command = args.shift().toLowerCase();
|
||||
|
||||
if (!client.commands.has(command)) return;
|
||||
const args = message.content.slice(config.prefix.length).split(/ +/);
|
||||
const command = args.shift().toLowerCase();
|
||||
|
||||
if (!client.commands.has(command)) return;
|
||||
|
||||
try {
|
||||
await client.commands.get(command).execute(client, message, args, footerTxt);
|
||||
} catch (error) {
|
||||
console.stack;
|
||||
message.channel.send({embed: {
|
||||
"title": "<:AnitroxError:809651936563429416> **Something went wrong!**",
|
||||
"description": error.stack,
|
||||
"color": 13632027,
|
||||
try {
|
||||
await client.commands.get(command).execute(client, message, args, config);
|
||||
} catch (error) {
|
||||
console.stack;
|
||||
message.channel.send({embed: {
|
||||
"title": "<:AnitroxError:809651936563429416> **Something went wrong!**",
|
||||
"description": error.stack,
|
||||
"color": 13632027,
|
||||
"footer": {
|
||||
"icon_url": message.author.displayAvatarURL(),
|
||||
"text": footerTxt
|
||||
"text": config.footerTxt
|
||||
},
|
||||
}});
|
||||
}
|
||||
});
|
||||
|
||||
client.login(token);
|
||||
client.login(config.token);
|
Reference in New Issue