Merge pull request #53 from Foxinatel/dev

Upgrade to discord.js v13
This commit is contained in:
Sophie Mondz 2022-04-29 17:47:15 -05:00 committed by GitHub
commit 95a458efc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 1198 additions and 761 deletions

17
.eslintrc.json Normal file
View File

@ -0,0 +1,17 @@
{
"env": {
"browser": true,
"commonjs": true,
"es2021": true
},
"extends": [
"standard"
],
"parserOptions": {
"ecmaVersion": "latest"
},
"rules": {
"no-eval": "off",
"semi": [1, "always"]
}
}

View File

@ -1,32 +1,47 @@
const { Constants } = require('discord.js');
module.exports = { module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: 'Ask Anitrox a question, any question! and they will answer it!', description: 'Ask Anitrox a question, any question! and they will answer it!',
syntax: ["[Question]"], options: [{
name: 'question',
async execute(client, message, args, config) { description: 'The question to ask Anitrox',
const index = Math.floor(Math.random() * config.answers.length); required: true,
const answer = config.answers[index] type: Constants.ApplicationCommandOptionTypes.STRING
const question = args.slice(0).join(" ") }],
if (!question) { async parseMessage (client, config, message, args) {
await message.channel.send(client.generateErrorMessage("You need to ask a question!")); await message.channel.send(this.handle(client, config, message.author, args.slice(0).join(' ')));
} else { },
await message.channel.send({embed: {
"title": ":8ball: 8Ball", async parseInteraction (client, config, interaction) {
"description": `Your amazing question: **${question}**`, await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getString('question')));
"color": 9442302, },
"footer": {
"icon_url": message.author.displayAvatarURL(), handle (client, config, user, question) {
"text": config.footerTxt const index = Math.floor(Math.random() * config.answers.length);
const answer = config.answers[index];
const avatarURL = user.displayAvatarURL();
if (!question) return client.generateErrorMessage('You need to ask a question!', avatarURL);
return {
embeds: [{
title: ':8ball: 8Ball',
description: `Your amazing question: **${question}**`,
color: 9442302,
footer: {
icon_url: avatarURL,
text: config.footerTxt
}, },
"fields": [ fields: [
{ {
"name": "Answer", name: 'Answer',
"value": `${answer}` value: `${answer}`
} }
] ]
}}); }]
} };
} }
} };

View File

@ -1,21 +1,45 @@
const { Constants } = require('discord.js');
module.exports = { module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: "Gets a user's avatar.", description: "Gets a user's avatar.",
options: [{
name: 'user',
description: 'Another user',
required: false,
type: Constants.ApplicationCommandOptionTypes.USER
},
{
name: 'userid',
description: "Another user's ID",
required: false,
type: Constants.ApplicationCommandOptionTypes.STRING
}],
async execute(client, message, args, config) { async parseMessage (client, config, message, args) {
const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author; const target = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author;
await message.channel.send(this.handle(client, config, message.author, target));
await message.channel.send({embed: { },
"title": `:frame_photo: ${user.username}'s Beautiful Avatar!`,
"color": 9442302, async parseInteraction (client, config, interaction) {
"footer": { const target = interaction.options.getUser('user') || client.users.cache.get(interaction.options.getString('userid')) || interaction.user;
"icon_url": message.author.displayAvatarURL(), await interaction.reply(this.handle(client, config, interaction.user, target));
"text": config.footerTxt },
},
"image": { handle (_, config, user, target) {
"url": user.displayAvatarURL() return {
} embeds: [{
}}); title: `:frame_photo: ${target.username}'s Beautiful Avatar!`,
color: 9442302,
footer: {
icon_url: user.displayAvatarURL(),
text: config.footerTxt
},
image: {
url: target.displayAvatarURL()
}
}]
};
} }
} };

View File

@ -1,26 +1,40 @@
module.exports = { const { Constants } = require('discord.js');
name: require('path').parse(__filename).name,
description: "Bonks a user!",
async execute(client, message, _, config) { module.exports = {
const taggedUser = message.mentions.users.first();
name: require('path').parse(__filename).name,
if(!taggedUser) { description: 'Bonks a user!',
await message.channel.send(client.generateErrorMessage("You need to @mention a user!")); options: [{
} else { name: 'user',
await message.channel.send({embed: { description: 'The user to bonk',
"title": "<a:SylvBonk:801185845847130113> Bonk", required: true,
"description": `${taggedUser} You have been bonked by ${message.author}!`, type: Constants.ApplicationCommandOptionTypes.USER
"color": 9442302, }],
"footer": {
"icon_url": message.author.displayAvatarURL(), async parseMessage (client, config, message) {
"text": config.footerTxt await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
},
handle (client, config, user, target) {
if (!target) return client.generateErrorMessage('You need to @mention a user!', user.displayAvatarURL());
return {
embeds: [{
title: '<a:SylvBonk:801185845847130113> Bonk',
description: `${target} You have been bonked by ${user}!`,
color: 9442302,
footer: {
icon_url: user.displayAvatarURL(),
text: config.footerTxt
}, },
"image": { image: {
"url": "https://cdn.discordapp.com/attachments/793537380330111028/801194481549312060/HappyBONK.gif" url: 'https://cdn.discordapp.com/attachments/793537380330111028/801194481549312060/HappyBONK.gif'
} }
}}); }]
} };
} }
} };

View File

@ -1,26 +1,40 @@
const { Constants } = require('discord.js');
module.exports = { module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: "Cheese an user, or run just ``n!cheese`` for a surprise :eyes:", description: 'Cheese a user, or run with no arguments for a surprise :eyes:',
options: [{
name: 'user',
description: 'The user to cheese',
required: false,
type: Constants.ApplicationCommandOptionTypes.USER
}],
async execute(_0, message, _1, config) { async parseMessage (client, config, message) {
const taggedUser = message.mentions.users.first(); await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
},
if(!taggedUser) {
await message.channel.send("*slams cheese on desk*\n**Cheese.** https://www.youtube.com/watch?v=Or4IE8fkpn4"); async parseInteraction (client, config, interaction) {
} else { await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
await message.channel.send({embed: { },
"title": ":cheese: Cheesed",
"description": `${taggedUser} You have been cheesed by ${message.author}!`, handle (_, config, user, target) {
"color": 16312092, if (!target) return '*slams cheese on desk*\n**Cheese.** https://www.youtube.com/watch?v=Or4IE8fkpn4';
"footer": {
"icon_url": message.author.displayAvatarURL(), return {
"text": config.footerTxt embeds: [{
title: ':cheese: Cheesed',
description: `${target} You have been cheesed by ${user}!`,
color: 16312092,
footer: {
icon_url: user.displayAvatarURL(),
text: config.footerTxt
}, },
"image": { image: {
"url": "https://cdn.discordapp.com/attachments/803658122299572255/812867714368536636/R06325af354168febcafd96b8328b7590.png" url: 'https://cdn.discordapp.com/attachments/803658122299572255/812867714368536636/R06325af354168febcafd96b8328b7590.png'
} }
}}); }]
} };
} }
} };

View File

@ -1,26 +1,42 @@
const { Constants } = require('discord.js');
module.exports = { module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: "Give some lines of input, and get one back at random", description: 'Give some lines of input, and get one back at random',
options: [...Array(10).keys()].map(i => ({
name: `option${i + 1}`,
description: 'Another option',
required: i === 0,
type: Constants.ApplicationCommandOptionTypes.STRING
})),
async execute(client, message, _, config) { async parseMessage (client, config, message, args) {
var [head, ...options] = message.content.split(/\s*\n\s*/); let [head, ...options] = message.content.split(/\s*\n\s*/);
head = head.slice(this.name.length + config.prefix.length); head = head.slice(this.name.length + config.prefix.length);
if (head) options.push(head); if (head) options.push(head);
await message.channel.send(this.handle(client, config, message.author, options));
},
if (!options.length) { async parseInteraction (client, config, interaction) {
await message.channel.send(client.generateErrorMessage("You need to provide some input!")); console.log([...Array(10).keys()].map(i => interaction.options.getString(`option${i + 1}`)).filter(str => str));
} else { await interaction.reply(this.handle(client, config, interaction.user, [...Array(10).keys()].map(i => interaction.options.getString(`option${i + 1}`)).filter(str => str)));
const answer = options[Math.floor(Math.random() * options.length)]; },
await message.channel.send({embed: {
"title": "I have made my decision:", handle (client, config, user, options) {
"description": answer, if (!options.length) return client.generateErrorMessage('You need to provide some input!', user.displayAvatarURL());
"color": 8311585,
"footer": { const answer = options[Math.floor(Math.random() * options.length)];
"icon_url": message.author.displayAvatarURL(), return {
"text": config.footerTxt embeds: [{
}, title: 'I have made my decision:',
}}); description: answer,
} color: 8311585,
footer: {
icon_url: user.displayAvatarURL(),
text: config.footerTxt
}
}]
};
} }
} };

View File

@ -2,33 +2,44 @@ module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: 'Attributions to open source components used by Anitrox', description: 'Attributions to open source components used by Anitrox',
options: [],
async execute(_0, message, _1, config){
await message.channel.send({embed: { async parseMessage (_, config, message) {
"title": "Contributors", await message.channel.send(this.handle(config, message.author));
"description": "Links to check out our contributors!", },
"color": 52508,
"footer": { async parseInteraction (_, config, interaction) {
"icon_url": message.author.displayAvatarURL(), await interaction.reply(this.handle(config, interaction.user));
"text": config.footerTxt },
},
"thumbnail": { handle (config, user) {
"url": "https://cdn.discordapp.com/emojis/809651812323164192.webp?size=128&quality=lossless" return {
}, embeds: [{
"fields": [ title: 'Contributors',
{ description: 'Links to check out our contributors!',
"name": "chuu_shi", color: 52508,
"value": "Thanks to Chuu for letting me use some of his resources to host Anitrox!\n <:GitHub:778165439477841981> [Check out his code!](https://github.com/chuushi)" footer: {
icon_url: user.displayAvatarURL(),
text: config.footerTxt
}, },
{ thumbnail: {
"name": "OfficialTCGMatt", url: 'https://cdn.discordapp.com/emojis/809651812323164192.webp?size=128&quality=lossless'
"value": "Matt has helped quite a bit with Anitrox, especially in the early days of Anitrox's development! He even has his own bot!\n <:GitHub:778165439477841981> [Check out his code!](https://github.com/OfficialTCGMatt)\n :robot: [Check out TheCodingBot!](https://github.com/TMC-Software/TheCodingBot)"
}, },
{ fields: [
"name": "Foxinatel", {
"value": "Foxi has made massive improvements to Anitrox, such as improving error handling, and much more!\n<:GitHub:778165439477841981> [Check out his code!](https://github.com/foxinatel)" name: 'chuu_shi',
} value: 'Thanks to Chuu for letting me use some of his resources to host Anitrox!\n <:GitHub:778165439477841981> [Check out his code!](https://github.com/chuushi)'
] },
}}); {
name: 'OfficialTCGMatt',
value: "Matt has helped quite a bit with Anitrox, especially in the early days of Anitrox's development! He even has his own bot!\n <:GitHub:778165439477841981> [Check out his code!](https://github.com/OfficialTCGMatt)\n :robot: [Check out TheCodingBot!](https://github.com/TMC-Software/TheCodingBot)"
},
{
name: 'Foxinatel',
value: 'Foxi has made massive improvements to Anitrox, such as improving error handling, and much more!\n<:GitHub:778165439477841981> [Check out his code!](https://github.com/foxinatel)'
}
]
}]
};
} }
} };

View File

@ -1,35 +1,48 @@
const { Constants } = require('discord.js');
const gifchoices = [ const gifchoices = [
"https://i.pinimg.com/originals/4d/89/d7/4d89d7f963b41a416ec8a55230dab31b.gif", 'https://i.pinimg.com/originals/4d/89/d7/4d89d7f963b41a416ec8a55230dab31b.gif',
"https://media1.tenor.com/images/6d73b0a9cadef5310be4b6160d2f959a/tenor.gif?itemid=12099823", 'https://media1.tenor.com/images/6d73b0a9cadef5310be4b6160d2f959a/tenor.gif?itemid=12099823',
"https://media.tenor.com/images/2636cf3c8152631b4630bf71757a4afa/tenor.gif", 'https://media.tenor.com/images/2636cf3c8152631b4630bf71757a4afa/tenor.gif',
"https://i.imgur.com/JiFpT5E.gif" 'https://i.imgur.com/JiFpT5E.gif'
]; ];
module.exports = { module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: "Cuddle an user!", description: 'Cuddle a user!',
options: [{
name: 'user',
description: 'The user to cuddle',
required: true,
type: Constants.ApplicationCommandOptionTypes.USER
}],
async execute(client, message, _, config) { async parseMessage (client, config, message) {
const taggedUser = message.mentions.users.first(); await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
const index = Math.floor(Math.random() * gifchoices.length); },
const gif = (gifchoices[index]);
if(!taggedUser) { async parseInteraction (client, config, interaction) {
await message.channel.send(client.generateErrorMessage("You need to @mention a user!")); await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
} else { },
await message.channel.send({embed: {
"title": ":heart: Cuddle", handle (client, config, user, target) {
"description": `${taggedUser} You have been cuddled by ${message.author}!`, if (!target) return client.generateErrorMessage('You need to @mention a user!', user.displayAvatarURL());
"color": 9442302,
"footer": { const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
"icon_url": message.author.displayAvatarURL(), return {
"text": config.footerTxt embeds: [{
title: ':heart: Cuddle',
description: `${target} You have been cuddled by ${user}!`,
color: 9442302,
footer: {
icon_url: user.displayAvatarURL(),
text: config.footerTxt
}, },
"image": { image: {
"url": gif url: gif
} }
}}); }]
} };
} }
} };

View File

@ -1,36 +1,53 @@
const { inspect } = require("util"); const { Constants } = require('discord.js');
const { inspect } = require('util');
module.exports = { module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: 'Executes JS code', description: 'handles JS code',
options: [{
name: 'code',
description: 'The string to evaluate',
required: true,
type: Constants.ApplicationCommandOptionTypes.STRING
}],
async execute(_, message, args, config) { async parseMessage (client, config, message, args) {
if (message.author.id == config.ownerID) { await message.channel.send(this.handle(client, config, message.author, args.join(' ')));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getString('code')));
},
handle (_, config, user, code) {
if (user.id === config.ownerID) {
try { try {
const code = args.join(" ");
const evaled = inspect(eval(code)); const evaled = inspect(eval(code));
await message.channel.send(evaled, {code:"xl"}); // await message.channel.send(evaled, { code: 'xl' });
return `\`\`\`js\n${evaled}\n\`\`\``;
} catch (error) { } catch (error) {
await message.channel.send({embed: { return {
"title": "<:AnitroxError:809651936563429416> **Something went wrong! **", embeds: [{
"color": 13632027, title: '<:AnitroxError:809651936563429416> **Something went wrong! **',
"footer": { color: 13632027,
"icon_url": message.author.displayAvatarURL(), footer: {
"text": config.footerTxt icon_url: user.displayAvatarURL(),
}, text: config.footerTxt
"fields": [
{
"name": "**What Happened?**",
"value": "The command you tried to run failed to execute due to an error."
}, },
{ fields: [
"name": "Error Info", {
"value": error.message name: '**What Happened?**',
} value: 'The command you tried to run failed to handle due to an error.'
] },
}}); {
name: 'Error Info',
value: error.message
}
]
}]
};
} }
}; };
} }
} };

View File

@ -1,28 +1,38 @@
module.exports = { module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: 'Get help on anything from commands, to what the bot does! just not your homework..', description: 'Get help on anything from commands, to what the bot does! just not your homework..',
syntax: '<Command>', options: [],
async execute(_0, message, _1, config) { async parseMessage (client, config, message) {
await message.channel.send({embed: { await message.channel.send(this.handle(client, config, message.author));
"title": "HELP! SEYMOUR! THE BOT IS ON FIRE!", },
"description": "Get help on anything from commands, to what the bot does! just not your homework..",
"color": 9442302, async parseInteraction (client, config, interaction) {
"footer": { await interaction.reply(this.handle(client, config, interaction.user));
"icon_url": message.author.displayAvatarURL(), },
"text": `${config.footerTxt} | No mother it's just the northern lights`
}, handle (_, config, user) {
"fields": [ return {
{ embeds: [{
"name": "Command List", title: 'HELP! SEYMOUR! THE BOT IS ON FIRE!',
"value": "[Click here!](https://github.com/IDeletedSystem64/anitrox/blob/dev/commands.md)" description: 'Get help on anything from commands, to what the bot does! just not your homework..',
color: 9442302,
footer: {
icon_url: user.displayAvatarURL(),
text: `${config.footerTxt} | No mother it's just the northern lights`
}, },
{ fields: [
"name": "...Or is the bot actually on fire?", {
"value": "Join the [support server!](https://discord.gg/grebRGsBZ3)" name: 'Command List',
} value: '[Click here!](https://github.com/IDeletedSystem64/anitrox/blob/dev/commands.md)'
] },
}}); {
name: '...Or is the bot actually on fire?',
value: 'Join the [support server!](https://discord.gg/grebRGsBZ3)'
}
]
}]
};
} }
} };

View File

@ -1,35 +1,49 @@
const { Constants } = require('discord.js');
const gifchoices = [ const gifchoices = [
"https://cdn.discordapp.com/attachments/803658122299572255/807670647920001044/hug2.gif", 'https://cdn.discordapp.com/attachments/803658122299572255/807670647920001044/hug2.gif',
"https://cdn.discordapp.com/attachments/803658122299572255/807670797983285268/hug1.gif", 'https://cdn.discordapp.com/attachments/803658122299572255/807670797983285268/hug1.gif',
"https://cdn.discordapp.com/attachments/803658122299572255/807670951113392178/gif6.gif", 'https://cdn.discordapp.com/attachments/803658122299572255/807670951113392178/gif6.gif',
"https://cdn.discordapp.com/attachments/803658122299572255/808834617494208532/gif3new.gif", 'https://cdn.discordapp.com/attachments/803658122299572255/808834617494208532/gif3new.gif',
"https://cdn.discordapp.com/attachments/803658122299572255/807671126376972308/gif4.gif" 'https://cdn.discordapp.com/attachments/803658122299572255/807671126376972308/gif4.gif'
]; ];
module.exports = { module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: "Hugs a user!", description: 'Hugs a user!',
options: [{
async execute(client, message, _, config) { name: 'user',
const taggedUser = message.mentions.users.first(); description: 'The user to hug',
required: true,
if(!taggedUser) { type: Constants.ApplicationCommandOptionTypes.USER
await message.channel.send(client.generateErrorMessage("You need to @mention a user!")); }],
} else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; async parseMessage (client, config, message) {
await message.channel.send({embed: { await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
"title": "<a:ABlobCatHuggle:801232248035999784> Hug", },
"description": `${taggedUser} You have been hugged by ${message.author}!`,
"color": 8311585, async parseInteraction (client, config, interaction) {
"footer": { await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
"icon_url": message.author.displayAvatarURL(), },
"text": config.footerTxt
handle (client, config, user, target) {
if (!target) return client.generateErrorMessage('You need to @mention a user!', user.displayAvatarURL());
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
return {
embeds: [{
title: '<a:ABlobCatHuggle:801232248035999784> Hug',
description: `${target} You have been hugged by ${user}!`,
color: 8311585,
footer: {
icon_url: user.displayAvatarURL(),
text: config.footerTxt
}, },
"image": { image: {
"url": gif url: gif
} }
}}); }]
} };
} }
} };

View File

@ -1,4 +1,4 @@
function Uptime(uptime) { function Uptime (uptime) {
const totalSeconds = (uptime / 1000); const totalSeconds = (uptime / 1000);
const days = parseInt(totalSeconds / 86400); const days = parseInt(totalSeconds / 86400);
@ -6,10 +6,10 @@ function Uptime(uptime) {
const minutes = parseInt((totalSeconds % 3600) / 60); const minutes = parseInt((totalSeconds % 3600) / 60);
const seconds = parseInt(totalSeconds % 60); const seconds = parseInt(totalSeconds % 60);
const daystring = days + (days === 1 ? " day" : " days"); const daystring = days + (days === 1 ? ' day' : ' days');
const hourstring = hours + (hours === 1 ? " hour" : " hours"); const hourstring = hours + (hours === 1 ? ' hour' : ' hours');
const minutetring = minutes + (minutes === 1 ? " minute" : " minutes"); const minutetring = minutes + (minutes === 1 ? ' minute' : ' minutes');
const secondstring = seconds + (seconds === 1 ? " second" : " seconds"); const secondstring = seconds + (seconds === 1 ? ' second' : ' seconds');
return `${daystring}**, **${hourstring}**, **${minutetring}**, **${secondstring}`; return `${daystring}**, **${hourstring}**, **${minutetring}**, **${secondstring}`;
} }
@ -18,90 +18,100 @@ module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: 'Shows bot and host information', description: 'Shows bot and host information',
options: [],
async execute(client, message, _, config) { async parseMessage (client, config, message) {
const os = require("os"); await message.channel.send(this.handle(client, config, message.author));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user));
},
async handle (client, config, user) {
const os = require('os');
const osu = require('node-os-utils'); const osu = require('node-os-utils');
const cpu = osu.cpu; const cpu = osu.cpu;
await message.channel.send({embed: {
"title": "<:AnitroxInfo:809651936831733791> Information about Anitrox",
"description": "Everything you've ever wanted to know about your favorite bot, Anitrox!",
"color": 9442302,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": config.footerTxt
},
"thumbnail": {
"url": client.user.displayAvatarURL()
},
"fields": [
{
"name": "Bot Information",
"value": "** **"
},
{
"name": "Release Type",
"value": config.release,
"inline": true
},
{
"name": "Release Version",
"value": config.build,
"inline": true
},
{
"name": "Uptime",
"value": Uptime(client.uptime),
"inline": true
},
{
"name": "<:memory:793536677737136178> Bot Memory Usage",
"value": `${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MiB`,
"inline": true
},
{
"name": "Bot Name",
"value": client.user.tag,
"inline": true
},
{
"name": "Bot ID",
"value": `\`${client.user.id}\``,
"inline": true
},
{
"name": "<:hostinfo:793529505263517747> Host Information",
"value": "** **"
},
{
"name": "<:hostinfo:793529505263517747> Host Uptime",
"value": Uptime(os.uptime() * 1000)
},
{
"name": "<:cpu:793672442056802354> CPU Type",
"value": `${process.arch}, ${cpu.model()}`
},
{ return {
"name": "<:hostos:793866961675223090> OS Type", embeds: [{
"value": `${process.platform} / ${os.version()}` title: '<:AnitroxInfo:809651936831733791> Information about Anitrox',
description: "Everything you've ever wanted to know about your favorite bot, Anitrox!",
color: 9442302,
footer: {
icon_url: user.displayAvatarURL(),
text: config.footerTxt
}, },
{ thumbnail: {
"name": "<:node:793537507018145813> Node.JS Version", url: client.user.displayAvatarURL()
"value": process.version
}, },
{ fields: [
"name": "<:hostinfo:793529505263517747> Bot Ping", {
"value": `${Math.round(client.ws.ping)} ms`, name: 'Bot Information',
"inline": true value: '** **'
}, },
{ {
"name": "**Special Thanks To**", name: 'Release Type',
"value": "@OfficialTCGMatt for providing help with development\n @chuu_shi Allowing me to host Anitrox on his server" value: config.release,
} inline: true
},
{
name: 'Release Version',
value: config.build,
inline: true
},
{
name: 'Uptime',
value: Uptime(client.uptime),
inline: true
},
{
name: '<:memory:793536677737136178> Bot Memory Usage',
value: `${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MiB`,
inline: true
},
{
name: 'Bot Name',
value: client.user.tag,
inline: true
},
{
name: 'Bot ID',
value: `\`${client.user.id}\``,
inline: true
},
{
name: '<:hostinfo:793529505263517747> Host Information',
value: '** **'
},
{
name: '<:hostinfo:793529505263517747> Host Uptime',
value: Uptime(os.uptime() * 1000)
},
{
name: '<:cpu:793672442056802354> CPU Type',
value: `${process.arch}, ${cpu.model()}`
},
] {
}}); name: '<:hostos:793866961675223090> OS Type',
value: `${process.platform} / ${os.version()}`
},
{
name: '<:node:793537507018145813> Node.JS Version',
value: process.version
},
{
name: '<:hostinfo:793529505263517747> Bot Ping',
value: `${Math.round(client.ws.ping)} ms`,
inline: true
},
{
name: '**Special Thanks To**',
value: '@OfficialTCGMatt for providing help with development\n @chuu_shi Allowing me to host Anitrox on his server'
}
]
}]
};
} }
}; };

View File

@ -2,34 +2,44 @@ module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: 'Add Anitrox to your beautiful server!', description: 'Add Anitrox to your beautiful server!',
syntax: [], options: [],
async execute(_0, message, _1, config) { async parseMessage (client, config, message) {
await message.channel.send({embed: { await message.channel.send(this.handle(client, config, message.author));
"title": "Add Anitrox to your Server!",
"description": "Weather you want stable, or that squeaky clean fresh PTB build, we gotchu.",
"color": 9442302,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": config.footerTxt
},
"thumbnail": {
"url": "https://cdn.discordapp.com/attachments/803658122299572255/814352905394061322/anitroxaddsrvr.png"
},
"fields": [
{
"name": "Anitrox",
"value": "Get the ripe off the vine Anitrox! \n [Add Anitrox to your server](https://discord.com/oauth2/authorize?client_id=576805923964715018&scope=bot&permissions=8)"
},
{
"name": "Anitrox PTB (Public Test Build)",
"value": "So you want the fresh and hot builds straight from the oven? We gotchu \n [Add Anitrox PTB to your server](https://discord.com/oauth2/authorize?client_id=489125054261755925&scope=bot&permissions=66186303)"
},
{
"name": "Need help?",
"value": "Come join the Anitrox Support Server, for support and much more!\n [Anitrox Support Server](https://discord.gg/grebRGsBZ3)"
}
]
}});
}, },
};
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user));
},
handle (_, config, user) {
return {
embeds: [{
title: 'Add Anitrox to your Server!',
description: 'Weather you want stable, or that squeaky clean fresh PTB build, we gotchu.',
color: 9442302,
footer: {
icon_url: user.displayAvatarURL(),
text: config.footerTxt
},
thumbnail: {
url: 'https://cdn.discordapp.com/attachments/803658122299572255/814352905394061322/anitroxaddsrvr.png'
},
fields: [
{
name: 'Anitrox',
value: 'Get the ripe off the vine Anitrox! \n [Add Anitrox to your server](https://discord.com/oauth2/authorize?client_id=576805923964715018&scope=bot&permissions=8)'
},
{
name: 'Anitrox PTB (Public Test Build)',
value: 'So you want the fresh and hot builds straight from the oven? We gotchu \n [Add Anitrox PTB to your server](https://discord.com/oauth2/authorize?client_id=489125054261755925&scope=bot&permissions=66186303)'
},
{
name: 'Need help?',
value: 'Come join the Anitrox Support Server, for support and much more!\n [Anitrox Support Server](https://discord.gg/grebRGsBZ3)'
}
]
}]
};
}
};

View File

@ -1,35 +1,49 @@
const { Constants } = require('discord.js');
const gifchoices = [ const gifchoices = [
"https://cdn.discordapp.com/attachments/803658122299572255/807671954055626812/kiss5.gif", 'https://cdn.discordapp.com/attachments/803658122299572255/807671954055626812/kiss5.gif',
"https://cdn.discordapp.com/attachments/803658122299572255/807671956236140554/kiss2.gif", 'https://cdn.discordapp.com/attachments/803658122299572255/807671956236140554/kiss2.gif',
"https://cdn.discordapp.com/attachments/803658122299572255/807671964599713862/kiss1.gif", 'https://cdn.discordapp.com/attachments/803658122299572255/807671964599713862/kiss1.gif',
"https://cdn.discordapp.com/attachments/803658122299572255/807671971168387082/kiss4.gif", 'https://cdn.discordapp.com/attachments/803658122299572255/807671971168387082/kiss4.gif',
"https://cdn.discordapp.com/attachments/803658122299572255/807672017217781840/kiss3.gif" 'https://cdn.discordapp.com/attachments/803658122299572255/807672017217781840/kiss3.gif'
]; ];
module.exports = { module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: "Kisses a user!", description: 'Kisses a user!',
options: [{
async execute(client, message, _, config) { name: 'user',
const taggedUser = message.mentions.users.first(); description: 'The user to kiss',
required: true,
if(!taggedUser) { type: Constants.ApplicationCommandOptionTypes.USER
await message.channel.send(client.generateErrorMessage("You need to @mention a user!")); }],
} else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; async parseMessage (client, config, message) {
await message.channel.send({embed: { await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
"title": ":heart: Kiss", },
"description": `${taggedUser} You have been kissed by ${message.author}!`,
"color": 9442302, async parseInteraction (client, config, interaction) {
"footer": { await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
"icon_url": message.author.displayAvatarURL(), },
"text": config.footerTxt
handle (client, config, user, target) {
if (!target) return client.generateErrorMessage('You need to @mention a user!', user.displayAvatarURL());
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
return {
embeds: [{
title: ':heart: Kiss',
description: `${target} You have been kissed by ${user}!`,
color: 9442302,
footer: {
icon_url: user.displayAvatarURL(),
text: config.footerTxt
}, },
"image": { image: {
"url": gif url: gif
} }
}}); }]
} };
} }
} };

View File

@ -1,45 +1,59 @@
const { Constants } = require('discord.js');
const gifchoices = [ const gifchoices = [
"https://cdn.discordapp.com/attachments/793537380330111028/803833954750038066/gif5.gif", 'https://cdn.discordapp.com/attachments/793537380330111028/803833954750038066/gif5.gif',
"https://cdn.discordapp.com/attachments/793537380330111028/803833959338475550/gif12.gif", 'https://cdn.discordapp.com/attachments/793537380330111028/803833959338475550/gif12.gif',
"https://cdn.discordapp.com/attachments/793537380330111028/803834034135236628/gif9.gif", 'https://cdn.discordapp.com/attachments/793537380330111028/803834034135236628/gif9.gif',
"https://cdn.discordapp.com/attachments/793537380330111028/803834082034843658/gif18.gif", 'https://cdn.discordapp.com/attachments/793537380330111028/803834082034843658/gif18.gif',
"https://cdn.discordapp.com/attachments/793537380330111028/803834094063583302/gif8.gif", 'https://cdn.discordapp.com/attachments/793537380330111028/803834094063583302/gif8.gif',
"https://cdn.discordapp.com/attachments/793537380330111028/803834099869024296/gif10.gif", 'https://cdn.discordapp.com/attachments/793537380330111028/803834099869024296/gif10.gif',
"https://cdn.discordapp.com/attachments/793537380330111028/803834132035665950/gif16.gif", 'https://cdn.discordapp.com/attachments/793537380330111028/803834132035665950/gif16.gif',
"https://cdn.discordapp.com/attachments/793537380330111028/803834146413084713/gif13.gif", 'https://cdn.discordapp.com/attachments/793537380330111028/803834146413084713/gif13.gif',
"https://cdn.discordapp.com/attachments/793537380330111028/803834249425715210/gif22.gif", 'https://cdn.discordapp.com/attachments/793537380330111028/803834249425715210/gif22.gif',
"https://cdn.discordapp.com/attachments/793537380330111028/803834323898990592/gif11.gif", 'https://cdn.discordapp.com/attachments/793537380330111028/803834323898990592/gif11.gif',
"https://cdn.discordapp.com/attachments/793537380330111028/803834328848793650/gif14.gif", 'https://cdn.discordapp.com/attachments/793537380330111028/803834328848793650/gif14.gif',
"https://cdn.discordapp.com/attachments/793537380330111028/803834391226351676/gif17.gif", 'https://cdn.discordapp.com/attachments/793537380330111028/803834391226351676/gif17.gif',
"https://cdn.discordapp.com/attachments/793537380330111028/803834391226351676/gif17.gif", 'https://cdn.discordapp.com/attachments/793537380330111028/803834391226351676/gif17.gif',
"https://cdn.discordapp.com/attachments/793537380330111028/803834498714304522/gif15.gif", 'https://cdn.discordapp.com/attachments/793537380330111028/803834498714304522/gif15.gif',
"https://cdn.discordapp.com/attachments/793537380330111028/803834514269798460/gif19.gif" 'https://cdn.discordapp.com/attachments/793537380330111028/803834514269798460/gif19.gif'
]; ];
module.exports = { module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: "Lesbian kiss <:lesbian:803831629428686849>", description: 'Lesbian kiss <:lesbian:803831629428686849>',
options: [{
async execute(client, message, _, config) { name: 'user',
const taggedUser = message.mentions.users.first(); description: 'The user to kiss',
required: true,
if(!taggedUser) { type: Constants.ApplicationCommandOptionTypes.USER
await message.channel.send(client.generateErrorMessage("You need to @mention a user!")); }],
} else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; async parseMessage (client, config, message) {
await message.channel.send({embed: { await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
"title": ":heart: <:lesbian:803831629428686849> Kiss", },
"description": `${taggedUser} You have been kissed by ${message.author}!`,
"color": 8311585, async parseInteraction (client, config, interaction) {
"footer": { await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
"icon_url": message.author.displayAvatarURL(), },
"text": config.footerTxt
handle (client, config, user, target) {
if (!target) return client.generateErrorMessage('You need to @mention a user!', user.displayAvatarURL());
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
return {
embeds: [{
title: ':heart: <:lesbian:803831629428686849> Kiss',
description: `${target} You have been kissed by ${user}!`,
color: 8311585,
footer: {
icon_url: user.displayAvatarURL(),
text: config.footerTxt
}, },
"image": { image: {
"url": gif url: gif
} }
}}); }]
} };
} }
} };

View File

@ -1,34 +1,47 @@
const { Constants } = require('discord.js');
const gifchoices = [ const gifchoices = [
"https://cdn.discordapp.com/attachments/803658122299572255/805314244123951114/cef569820773b0f5d54ee34cfa18e1f8.gif", 'https://cdn.discordapp.com/attachments/803658122299572255/805314244123951114/cef569820773b0f5d54ee34cfa18e1f8.gif',
"https://cdn.lowgif.com/full/2027501b8fa5225c-.gif", 'https://cdn.lowgif.com/full/2027501b8fa5225c-.gif',
"https://i.gifer.com/36Nx.gif", 'https://i.gifer.com/36Nx.gif',
"https://media.tenor.com/images/e8bbe712a5f36bbe9545930894b08bf9/tenor.gif" 'https://media.tenor.com/images/e8bbe712a5f36bbe9545930894b08bf9/tenor.gif'
]; ];
module.exports = { module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: "Licks a user!", description: 'Licks a user!',
options: [{
async execute(client, message, _, config) { name: 'user',
const taggedUser = message.mentions.users.first(); description: 'The user to lick',
required: true,
type: Constants.ApplicationCommandOptionTypes.USER
}],
if(!taggedUser) { async parseMessage (client, config, message) {
await message.channel.send(client.generateErrorMessage("You need to @mention a user!")); await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
} else { },
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: { async parseInteraction (client, config, interaction) {
"title": "<a:LeafeonLick:806396195089154058> Lick", await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
"description": `${taggedUser} You have been licked by ${message.author}!`, },
"color": 8311585,
"footer": { handle (client, config, user, target) {
"icon_url": message.author.displayAvatarURL(), if (!target) return client.generateErrorMessage('You need to @mention a user!', user.displayAvatarURL());
"text": config.footerTxt const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
return {
embeds: [{
title: '<a:LeafeonLick:806396195089154058> Lick',
description: `${target} You have been licked by ${user}!`,
color: 8311585,
footer: {
icon_url: user.displayAvatarURL(),
text: config.footerTxt
}, },
"image": { image: {
"url": "https://cdn.discordapp.com/attachments/803658122299572255/805314244123951114/cef569820773b0f5d54ee34cfa18e1f8.gif" url: gif
} }
}}); }]
} };
} }
} };

View File

@ -1,34 +1,48 @@
const { Constants } = require('discord.js');
const gifchoices = [ const gifchoices = [
"https://i.imgur.com/Ns1RBzX.gif", 'https://i.imgur.com/Ns1RBzX.gif',
"https://cdn.lowgif.com/full/2027501b8fa5225c-.gif", 'https://cdn.lowgif.com/full/2027501b8fa5225c-.gif',
"https://i.gifer.com/36Nx.gif", 'https://i.gifer.com/36Nx.gif',
"https://media.tenor.com/images/e8bbe712a5f36bbe9545930894b08bf9/tenor.gif" 'https://media.tenor.com/images/e8bbe712a5f36bbe9545930894b08bf9/tenor.gif'
]; ];
module.exports = { module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: "Noms an user!", description: 'Noms a user!',
options: [{
async execute(client, message, _, config) { name: 'user',
const taggedUser = message.mentions.users.first(); description: 'The user to nom',
required: true,
type: Constants.ApplicationCommandOptionTypes.USER
}],
if(!taggedUser) { async parseMessage (client, config, message) {
await message.channel.send(client.generateErrorMessage("You need to @mention a user!")); await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
} else { },
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: { async parseInteraction (client, config, interaction) {
"title": "<:BlobNomBlob:801241117919805510> Nom", await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
"description": `${taggedUser} You have been nommed by ${message.author}!`, },
"color": 8311585,
"footer": { handle (client, config, user, target) {
"icon_url": message.author.displayAvatarURL(), if (!target) return client.generateErrorMessage('You need to @mention a user!', user.displayAvatarURL());
"text": config.footerTxt
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
return {
embeds: [{
title: '<:BlobNomBlob:801241117919805510> Nom',
description: `${target} You have been nommed by ${user}!`,
color: 8311585,
footer: {
icon_url: user.displayAvatarURL(),
text: config.footerTxt
}, },
"image": { image: {
"url": gif url: gif
} }
}}); }]
} };
} }
} };

View File

@ -1,33 +1,46 @@
const { Constants } = require('discord.js');
const gifchoices = [ const gifchoices = [
"https://cdn.discordapp.com/attachments/803658122299572255/803708174293008474/tenor.gif", 'https://cdn.discordapp.com/attachments/803658122299572255/803708174293008474/tenor.gif',
"https://community.gamepress.gg/uploads/default/original/3X/0/a/0a762099c5ad6de9ca5f13dd22a7e45884a99eb3.gif", 'https://community.gamepress.gg/uploads/default/original/3X/0/a/0a762099c5ad6de9ca5f13dd22a7e45884a99eb3.gif',
"https://media1.giphy.com/media/ARSp9T7wwxNcs/giphy.gif" 'https://media1.giphy.com/media/ARSp9T7wwxNcs/giphy.gif'
]; ];
module.exports = { module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: "Pats a user!", description: 'Pats a user!',
options: [{
async execute(client, message, _, config) { name: 'user',
const taggedUser = message.mentions.users.first(); description: 'The user to pat',
required: true,
if(!taggedUser) { type: Constants.ApplicationCommandOptionTypes.USER
await message.channel.send(client.generateErrorMessage("You need to @mention a user!")); }],
} else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; async parseMessage (client, config, message) {
await message.channel.send({embed: { await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
"title": "<:pats:801238281286713355> Pat", },
"description": `${taggedUser} You have been patted by ${message.author}!`,
"color": 8311585, async parseInteraction (client, config, interaction) {
"footer": { await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
"icon_url": message.author.displayAvatarURL(), },
"text": config.footerTxt
handle (client, config, user, target) {
if (!target) return client.generateErrorMessage('You need to @mention a user!', user.displayAvatarURL());
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
return {
embeds: [{
title: '<:pats:801238281286713355> Pat',
description: `${target} You have been patted by ${user}!`,
color: 8311585,
footer: {
icon_url: user.displayAvatarURL(),
text: config.footerTxt
}, },
"image": { image: {
"url": gif url: gif
} }
}}); }]
} };
} }
} };

View File

@ -1,20 +1,31 @@
module.exports = { module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: "Gets bot ping", description: 'Gets bot ping',
options: [],
async execute(client, message, _, config) {
const index = Math.floor(Math.random() * config.locations.length); async parseMessage (client, config, message, args) {
const location = config.locations[index] await message.channel.send(await this.handle(client, config, message.author));
},
await message.channel.send({embed:{
"title": ":ping_pong: Ping", async parseInteraction (client, config, interaction) {
"description": `**Pong!** We pinged **${location}** and got ${client.ws.ping} ms.`, await interaction.reply(await this.handle(client, config, interaction.user));
"color": 9442302, },
"footer": {
"icon_url": message.author.displayAvatarURL(), async handle (client, config, user) {
"text": config.footerTxt const index = Math.floor(Math.random() * config.locations.length);
} const location = config.locations[index];
}});
return {
embeds: [{
title: ':ping_pong: Ping',
description: `**Pong!** We pinged **${location}** and got ${client.ws.ping} ms.`,
color: 9442302,
footer: {
icon_url: user.displayAvatarURL(),
text: config.footerTxt
}
}]
};
} }
}; };

View File

@ -1,33 +1,47 @@
const { Constants } = require('discord.js');
const gifchoices = [ const gifchoices = [
"https://i.pinimg.com/originals/b4/95/fb/b495fb19f4b9a1b04f48297b676c497b.gif", 'https://i.pinimg.com/originals/b4/95/fb/b495fb19f4b9a1b04f48297b676c497b.gif',
"https://i.imgur.com/H7Ok5tn.gif", 'https://i.imgur.com/H7Ok5tn.gif',
"https://media1.tenor.com/images/8fe23ec8e2c5e44964e5c11983ff6f41/tenor.gif?itemid=5600215" 'https://media1.tenor.com/images/8fe23ec8e2c5e44964e5c11983ff6f41/tenor.gif?itemid=5600215'
]; ];
module.exports = { module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: "Pokes a user!", description: 'Pokes a user!',
options: [{
async execute(client, message, _, config) { name: 'user',
const taggedUser = message.mentions.users.first(); description: 'The user to poke',
required: true,
if(!taggedUser) { type: Constants.ApplicationCommandOptionTypes.USER
await message.channel.send(client.generateErrorMessage("You need to @mention a user!")); }],
} else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; async parseMessage (client, config, message) {
await message.channel.send({embed: { await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
"title": "👉 Poke!", },
"description": `${taggedUser} You have been poked by ${message.author}!`,
"color": 8311585, async parseInteraction (client, config, interaction) {
"footer": { await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
"icon_url": message.author.displayAvatarURL(), },
"text": config.footerTxt
handle (client, config, user, target) {
if (!target) return client.generateErrorMessage('You need to @mention a user!', user.displayAvatarURL());
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
return {
embeds: [{
title: '👉 Poke!',
description: `${target} You have been poked by ${user}!`,
color: 8311585,
footer: {
icon_url: user.displayAvatarURL(),
text: config.footerTxt
}, },
"image": { image: {
"url": gif url: gif
} }
}}); }]
} };
} }
} };

View File

@ -1,50 +1,69 @@
const { Constants } = require('discord.js');
module.exports = { module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: 'Reloads a command', description: 'Reloads a command',
options: [...Array(10).keys()].map(i => ({
name: `option${i + 1}`,
description: 'Another option',
required: i === 0,
type: Constants.ApplicationCommandOptionTypes.STRING
})),
async parseMessage (client, config, message, args) {
await message.channel.send(this.handle(client, config, message.author, args));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user, [...Array(10).keys()].map(i => interaction.options.getString(`option${i + 1}`)).filter(str => str)));
},
handle (client, config, user, args) {
if (user.id === config.ownerID) {
if (!args.length) return client.generateErrorMessage('You forgot to provide anything to reload, you pillock', user.displayAvatarURL());
let returnMessage = '';
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()));
}
args.forEach(async (arg) => { args.forEach(async (arg) => {
const commandName = arg.toLowerCase(); const commandName = arg?.toLowerCase();
const command = message.client.commands.get(commandName) const command = client.commands.get(commandName) ||
|| message.client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName)); client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName));
if (!command) { if (!command) {
await message.channel.send(client.generateErrorMessage(`There is no command with name or alias \`${commandName}\`, ${message.author}!`,message.author.displayAvatarURL())); returnMessage += `There is no command with name or alias \`${commandName}\`\n`;
} else { } else {
delete require.cache[require.resolve(`./${command.name}.js`)]; delete require.cache[require.resolve(`./${command.name}.js`)];
try { try {
const newCommand = require(`./${command.name}.js`); const newCommand = require(`./${command.name}.js`);
client.commands.set(newCommand.name, newCommand); client.commands.set(newCommand.name, newCommand);
await message.channel.send(`<:AnitroxSuccess:809651936819019796> **Reloaded \`${command.name}\` successfully!**`); returnMessage += `Successfully reloaded \`${commandName}\`\n`;
console.log(`User reloaded ${command.name}.`) console.log(`User reloaded ${command.name}.`);
} catch (error) { } catch (error) {
console.error(error); console.error(error);
await message.channel.send(client.generateErrorMessage(`There was an error while reloading \`${command.name}\`:\n\`${error.message}\``, message.author.displayAvatarURL())); returnMessage += `There was an error while reloading \`${command.name}\`\n`;
} }
} }
}); });
return returnMessage;
} else { } else {
message.channel.send({embed: { return {
"title": "<:AnitroxDenied:809651936642203668> **403 Forbidden**", embeds: [{
"color": 13632027, title: '<:AnitroxDenied:809651936642203668> **403 Forbidden**',
"footer": { color: 13632027,
"icon_url": message.author.displayAvatarURL(), footer: {
"text": config.footerTxt icon_url: user.displayAvatarURL(),
}, text: config.footerTxt
"fields": [ },
{ fields: [
"name": "**What Happened?**", {
"value": "You don't have the appropriate permissions to run this command!" name: '**What Happened?**',
} value: "You don't have the appropriate permissions to run this command!"
] }
}}); ]
}]
};
} }
} }
}; };

View File

@ -2,19 +2,28 @@ module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: 'Restarts the bot', description: 'Restarts the bot',
options: [],
async execute(client, message, _, config) {
if (message.author.id == config.ownerID) { async parseMessage (client, config, message) {
console.log("Anitrox is restarting now!") await message.channel.send(await this.handle(client, config, message.author));
await message.channel.send("<a:NyabotWorking:697147309531594843> Restarting...") },
async parseInteraction (client, config, interaction) {
await interaction.reply(await this.handle(client, config, interaction.user));
},
async handle (client, config, user) {
if (user.id === config.ownerID) {
console.log('Anitrox is restarting now!');
// await message.channel.send('<a:NyabotWorking:697147309531594843> Restarting...');
try { try {
client.destroy(); client.destroy();
await client.login(config.token); await client.login(config.token);
await message.channel.send("<:NyabotSuccess:697211376740859914> Restart Successful") console.log('All systems go');
console.log("All systems go") return '<:NyabotSuccess:697211376740859914> Restart Successful';
} catch(e) {console.log(e);} } catch (e) { console.error(e); }
} else { } else {
await message.channel.send("<:NyabotDenied:697145462565896194> Access Denied, You must be bot owner to execute this command."); return '<:NyabotDenied:697145462565896194> Access Denied, You must be bot owner to execute this command.';
} }
} }
} };

View File

@ -1,37 +1,59 @@
const { Constants } = require('discord.js');
module.exports = { module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: 'Sets your nickname', description: 'Sets your nickname',
options: [{
name: 'name',
description: 'The new nickname',
required: true,
type: Constants.ApplicationCommandOptionTypes.STRING
}],
async execute(client, message, args, config) { async parseMessage (client, config, message) {
if (message.channel.permissionsFor(message.author).has("CHANGE_NICKNAME")) { await message.channel.send(this.handle(client, config, message.author));
const newnick = args.slice(0).join(" ") },
try {
await message.member.setNickname(newnick, "Nickname change requested by the server member. If you don't want users to be able to change their nickname disable 'CHANGE_NICKNAME' via Change Nickname in Roles.") async parseInteraction (client, config, interaction) {
await message.channel.send({embed: { await interaction.reply(this.handle(client, config, interaction.user));
"title": "<:AnitroxSuccess:809651936819019796> Nickname Changed", },
"color": 9442302,
"footer": { handle (client, config, user, newNick) {
"icon_url": message.author.displayAvatarURL(), return "Discord has an inbuilt slash command for this, so I think it's best we deprecate this";
"text": config.footerTxt
}, // const avatarURL = message.author.displayAvatarURL();
"fields": [
{ // if (message.channel.permissionsFor(message.author).has('CHANGE_NICKNAME')) {
"name": "Changed nickname successfully!", // const newnick = args.slice(0).join(' ');
"value": `New Nickname: ${newnick}` // try {
}, // await message.member.setNickname(newnick, "Nickname change requested by the server member. If you don't want users to be able to change their nickname disable 'CHANGE_NICKNAME' via Change Nickname in Roles.");
{ // await message.channel.send({
"name": "New Nickname", // embeds: [{
"value": newnick, // title: '<:AnitroxSuccess:809651936819019796> Nickname Changed',
"inline": true // color: 9442302,
} // footer: {
] // icon_url: message.author.displayAvatarURL(),
}}); // text: config.footerTxt
} catch (error) { // },
await message.channel.send(client.generateErrorMessage("Failed to set user nickname. Does the bot have the correct permissions?", message.author.displayAvatarURL())); // fields: [
}; // {
} else { // name: 'Changed nickname successfully!',
await message.channel.send(client.generateErrorMessage("You need to have permission ``CHANGE_NICKNAME`` to change your nick!", message.author.displayAvatarURL())); // value: `New Nickname: ${newnick}`
} // },
// {
// name: 'New Nickname',
// value: newnick,
// inline: true
// }
// ]
// }]
// });
// } catch (error) {
// await message.channel.send(client.generateErrorMessage('Failed to set user nickname. Does the bot have the correct permissions?', avatarURL));
// };
// } else {
// await message.channel.send(client.generateErrorMessage('You need to have permission ``CHANGE_NICKNAME`` to change your nick!', avatarURL));
// }
} }
} };

View File

@ -1,26 +1,39 @@
const { Constants } = require('discord.js');
module.exports = { module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: "Slaps an user!", description: 'Slaps a user!',
options: [{
async execute(client, message, _, config) { name: 'user',
const taggedUser = message.mentions.users.first(); description: 'The user to slap',
required: true,
type: Constants.ApplicationCommandOptionTypes.USER
}],
if(!taggedUser) { async parseMessage (client, config, message) {
await message.channel.send(client.generateErrorMessage("You need to @mention a user!")); await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
} else { },
await message.channel.send({embed: {
"title": ":anger: Slap", async parseInteraction (client, config, interaction) {
"description": `${taggedUser} You have been slapped by ${message.author}!`, await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
"color": 9442302, },
"footer": {
"icon_url": message.author.displayAvatarURL(), handle (client, config, user, target) {
"text": config.footerTxt if (!target) return client.generateErrorMessage('You need to @mention a user!', user.displayAvatarURL());
return {
embeds: [{
title: ':anger: Slap',
description: `${target} You have been slapped by ${user}!`,
color: 9442302,
footer: {
icon_url: user.displayAvatarURL(),
text: config.footerTxt
}, },
"image": { image: {
"url": "https://media1.tenor.com/images/b6d8a83eb652a30b95e87cf96a21e007/tenor.gif?itemid=10426943" url: 'https://media1.tenor.com/images/b6d8a83eb652a30b95e87cf96a21e007/tenor.gif?itemid=10426943'
} }
}}); }]
} };
} }
} };

View File

@ -1,34 +1,47 @@
const gifchoices = [ const { Constants } = require('discord.js');
"https://media.discordapp.net/attachments/803658122299572255/806775382995894282/anime-couple-snuggle-gif-5.gif?width=450&height=238",
"https://media.discordapp.net/attachments/803658122299572255/806775411928989726/snuggl1.gif",
"https://cdn.discordapp.com/attachments/803658122299572255/806775422833786911/ImpureDeepAmbushbug-small.gif"
];
const gifchoices = [
'https://media.discordapp.net/attachments/803658122299572255/806775382995894282/anime-couple-snuggle-gif-5.gif?width=450&height=238',
'https://media.discordapp.net/attachments/803658122299572255/806775411928989726/snuggl1.gif',
'https://cdn.discordapp.com/attachments/803658122299572255/806775422833786911/ImpureDeepAmbushbug-small.gif'
];
module.exports = { module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: "Snuggle an user!", description: 'Snuggle a user!',
options: [{
async execute(client, message, _, config) { name: 'user',
const taggedUser = message.mentions.users.first(); description: 'The user to snuggle',
required: true,
if(!taggedUser) { type: Constants.ApplicationCommandOptionTypes.USER
await message.channel.send(client.generateErrorMessage("You need to @mention a user!")); }],
} else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; async parseMessage (client, config, message) {
await message.channel.send({embed: { await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
"title": "<:BlobSnuggleCat:806759753450782731> Snuggle", },
"description": `${taggedUser} You have been snuggled by ${message.author}!`,
"color": 9442302, async parseInteraction (client, config, interaction) {
"footer": { await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
"icon_url": message.author.displayAvatarURL(), },
"text": config.footerTxt
handle (client, config, user, target) {
if (!target) return client.generateErrorMessage('You need to @mention a user!', user.displayAvatarURL());
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
return {
embeds: [{
title: '<:BlobSnuggleCat:806759753450782731> Snuggle',
description: `${target} You have been snuggled by ${user}!`,
color: 9442302,
footer: {
icon_url: user.displayAvatarURL(),
text: config.footerTxt
}, },
"image": { image: {
"url": gif url: gif
} }
}}); }]
} };
} }
} };

View File

@ -2,30 +2,44 @@ module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: "IT'S TIME TO STOP!... the bot", description: "IT'S TIME TO STOP!... the bot",
options: [],
async execute(_0, message, _1, config) {
if (message.author.id == config.ownerID) { async parseMessage (client, config, message) {
await message.channel.send({embed: { await message.channel.send(await this.handle(client, config, message.author));
"title": "<a:AnitroxWorking:697147309531594843> **Shutting Down...**", process.exit();
"description": "See you next time!", },
"color": 9442302,
"footer": { async parseInteraction (client, config, interaction) {
"icon_url": message.author.displayAvatarURL(), await interaction.reply(await this.handle(client, config, interaction.user));
"text": config.footerTxt process.exit();
}, },
}});
console.log("The bot is shutting down! Bye bye!") async handle (_, config, user) {
process.exit(); if (user.id === config.ownerID) {
console.log('The bot is shutting down! Bye bye!');
return {
embeds: [{
title: '<a:AnitroxWorking:697147309531594843> **Shutting Down...**',
description: 'See you next time!',
color: 9442302,
footer: {
icon_url: user.displayAvatarURL(),
text: config.footerTxt
}
}]
};
} else { } else {
await message.channel.send({embed: { return {
"title": "<:AnitroxDenied:809651936642203668> 403 Forbidden", embeds: [{
"description": "You need to be the bot owner to execute this command!", title: '<:AnitroxDenied:809651936642203668> 403 Forbidden',
"color": 13632027, description: 'You need to be the bot owner to execute this command!',
"footer": { color: 13632027,
"icon_url": message.author.displayAvatarURL(), footer: {
"text": config.footerTxt icon_url: user.displayAvatarURL(),
}, text: config.footerTxt
}}); }
}]
};
} }
} }
} };

View File

@ -1,57 +1,73 @@
const { Constants } = require('discord.js');
module.exports = { module.exports = {
name: require('path').parse(__filename).name, name: require('path').parse(__filename).name,
description: "Gets info about an user, such as ID, Discord Join date and more", description: 'Gets info about an user, such as ID, Discord Join date and more',
syntax: "<User>", options: [{
name: 'user',
description: 'Another user',
required: false,
type: Constants.ApplicationCommandOptionTypes.USER
}],
async execute(client, message, args, config) { async parseMessage (client, config, message) {
const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author const target = message.mentions.members.first() || message.member;
await message.channel.send(this.handle(client, config, message.author, target));
await message.channel.send({embed: { },
"title": `Everything you've ever wanted to know about ${user.username}!`,
"color": 9442302, async parseInteraction (client, config, interaction) {
"footer": { const target = interaction.options.getUser('user') ? (await interaction.guild.members.fetch(interaction.options.getUser('user'))) : interaction.member;
"icon_url": message.author.displayAvatarURL(), await interaction.reply(this.handle(client, config, interaction.user, target));
"text": config.footerTxt },
},
"thumbnail": { handle (client, config, user, target) {
"url": user.displayAvatarURL() return {
}, embeds: [{
"fields": [ title: `Everything you've ever wanted to know about ${target}!`,
color: 9442302,
{ footer: {
"name": "Username", icon_url: user.displayAvatarURL(),
"value": user.username, text: config.footerTxt
"inline": true
}, },
{ thumbnail: {
"name": "Discriminator", url: target.displayAvatarURL()
"value": user.discriminator,
"inline": true
}, },
{ fields: [
"name": "Full Username", {
"value": user.tag, name: 'Username',
"inline": true value: target.user.username,
}, inline: true
{ },
"name": "User Profile Picture", {
"value": user.displayAvatarURL() name: 'Discriminator',
}, value: target.user.discriminator,
{ inline: true
"name": "User Status", },
value: user.presence.status {
}, name: 'Full Username',
{ value: target.user.tag,
"name": "User ID", inline: true
"value": `\`${user.id}\`` },
}, {
{ name: 'User Profile Picture',
"name": "User Joined Discord", value: target.user.displayAvatarURL()
"value": user.createdAt, },
inline: true {
}, name: 'User Status',
] value: target.presence?.status ?? (config.intents.includes('GUILD_PRESENCES') ? 'Offline' : 'Missing GUILD_PRESENCES intent')
}}); },
{
name: 'User ID',
value: `\`${target.user.id}\``
},
{
name: 'User Joined Discord',
value: target.user.createdAt.toString(),
inline: true
}
]
}]
};
} }
} };

View File

@ -1,21 +1,27 @@
{ {
"prefix": "n!", "prefix": "n!",
"token": "IM SO EXCITED ABOUT BURGER", "token": "IM SO EXCITED ABOUT BURGER",
"ownerID": "MY FAVORITE COLOR IS TWELVE", "ownerID": "MY FAVORITE COLOR IS TWELVE",
"release": "anitrox_dev", "release": "anitrox_dev",
"build": "Stable", "build": "Stable",
"footerTxt": "Anitrox, made with <3 by IDeletedSystem64 | 2018-2022", "footerTxt": "Anitrox, made with <3 by IDeletedSystem64 | 2018-2022",
"sandbox": {
"statuses": [ "enabled": false,
"with np!help", "id": "788391989460205571",
"with Sophie!", "refreshLocal": false,
"Trans Rights!", "refreshGlobal": false
"in your computer", },
"with my internet router",
"ssh: system64@borkeonv2", "statuses": [
"YouTube", "with np!help",
"with source code", "with Sophie!",
"Visual Studio Code", "Trans Rights!",
"in your computer",
"with my internet router",
"ssh: system64@borkeonv2",
"YouTube",
"with source code",
"Visual Studio Code",
"Minecraft", "Minecraft",
"with the network connections.", "with the network connections.",
"VLC Media Player", "VLC Media Player",
@ -53,5 +59,10 @@
"Go for it! :smile:", "Go for it! :smile:",
"Good idea!", "Good idea!",
"Sure" "Sure"
],
"intents": [
"GUILDS",
"GUILD_MESSAGES",
"GUILD_PRESENCES"
] ]
} }

View File

@ -4,13 +4,17 @@
"description": "Discord Bot Based on Discord.JS", "description": "Discord Bot Based on Discord.JS",
"main": "start.js", "main": "start.js",
"dependencies": { "dependencies": {
"discord.js": "^12.5.1", "discord.js": "^13.6.0",
"node-os-utils": "^1.3.2", "node-os-utils": "^1.3.2",
"require-all": "^3.0.0" "require-all": "^3.0.0"
}, },
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "IDeletedSystem64", "author": "IDeletedSystem64",
"license": "ISC" "license": "ISC",
"devDependencies": {
"eslint": "^8.13.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.1.0",
"eslint-plugin-promise": "^6.0.0"
}
} }

122
start.js
View File

@ -3,77 +3,115 @@
const fs = require('fs'); const fs = require('fs');
const Discord = require('discord.js'); const Discord = require('discord.js');
const config = require('./config.json'); const config = require('./config.json');
console.log('Starting!') console.log('Starting!');
const client = new Discord.Client(); const client = new Discord.Client({ intents: config.intents.map(intent => eval(`Discord.Intents.FLAGS.${intent}`)) });
client.commands = new Discord.Collection(); client.commands = new Discord.Collection();
fs.readdirSync('./commands').filter(file => file.endsWith('.js')).forEach(file => {
const command = require(`./commands/${file}`);
client.commands.set(command.name, command);
});
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js')); client.generateErrorMessage = (errorMsg, avatarURL) => ({
embeds: [{
title: '<:AnitroxError:809651936563429416> Error',
color: 13632027,
footer: {
icon_url: avatarURL,
text: config.footerTxt
},
fields: [
{
name: 'Something went wrong!',
value: errorMsg
}
]
}]
});
for (const file of commandFiles) { client.on('error', (e) => console.log(`[ERROR] ${e}`));
const command = require(`./commands/${file}`); client.on('warn', (e) => (`[WARN] ${e}`));
client.commands.set(command.name, command); client.once('ready', async () => {
} const sandboxSettings = config.sandbox;
const localCommands = client.guilds.cache.get(sandboxSettings.id)?.commands;
const globalCommands = client.application.commands;
let existingLocal = await localCommands.fetch();
let existingGlobal = await globalCommands.fetch();
client.generateErrorMessage = (errorMsg, messageAuthorURL) => ({embed: { if (sandboxSettings.enabled) {
"title": "<:AnitroxError:809651936563429416> Error", if (sandboxSettings.refreshLocal) {
"color": 13632027, console.log('deleting previous local commands');
"footer": { existingLocal.forEach(async x => {
"icon_url": message.author.displayAvatarURL(), await localCommands.delete(x);
"text": config.footerTxt });
}, existingLocal = new Discord.Collection();
"fields": [
{
"name": "Something went wrong!",
"value": errorMsg
} }
]
}})
client.on("error", (e) => console.log(`[ERROR] ${error(e)}`)); if (sandboxSettings.refreshGlobal) {
client.on("warn", (e) => (`[WARN] ${warn(e)}`)); console.log('deleting previous global commands');
client.once('ready', () => { existingGlobal.forEach(async x => {
console.clear() await client.application.commands.delete(x);
});
existingGlobal = new Discord.Collection();
}
}
client.commands.forEach(async command => {
if (sandboxSettings.enabled && !existingLocal.map(x => x.name).includes(command.name)) {
await localCommands.create(command);
// console.log(`created new local command ${command.name}`);
}
if (!existingGlobal.map(x => x.name).includes(command.name)) {
await globalCommands.create(command);
// console.log(`created new global command ${command.name}`);
}
});
console.clear();
console.log(' ___ _ __ '); console.log(' ___ _ __ ');
console.log(' / | ____ (_) /__________ _ __'); console.log(' / | ____ (_) /__________ _ __');
console.log(' / /| | / __ \\/ / __/ ___/ __ \\| |/_/'); console.log(' / /| | / __ \\/ / __/ ___/ __ \\| |/_/');
console.log(' / ___ |/ / / / / /_/ / / /_/ /> < '); console.log(' / ___ |/ / / / / /_/ / / /_/ /> < ');
console.log('/_/ |_/_/ /_/_/\\__/_/ \\____/_/|_| '); console.log('/_/ |_/_/ /_/_/\\__/_/ \\____/_/|_| ');
console.log(`${config.release}, ${config.build}`); console.log(`${config.release}, ${config.build}`);
console.log("Bot online. | Anitrox by IDeletedSystem64 | ALL MY CODE KEEPS BLOWING UP!"); console.log('Bot online. | Anitrox by IDeletedSystem64 | ALL MY CODE KEEPS BLOWING UP!');
// Statuses // Statuses
setInterval(async () => { setInterval(async () => {
// Picks a status from the config file // Picks a status from the config file
const index = Math.floor(Math.random() * config.statuses.length); const index = Math.floor(Math.random() * config.statuses.length);
await client.user.setActivity(config.statuses[index]); await client.user.setActivity(config.statuses[index]);
}, 20000); }, 20000);
}); });
// Begin Command Handler // Begin Command Handler
client.on('message', async (message) => { client.on('messageCreate', async (message) => {
if (!message.content.startsWith(config.prefix) || message.author.bot) return; if (!message.content.startsWith(config.prefix) || message.author.bot) return;
const args = message.content.slice(config.prefix.length).split(/\s+/); const args = message.content.slice(config.prefix.length).split(/\s+/);
const command = args.shift().toLowerCase(); const command = args.shift().toLowerCase();
if (!client.commands.has(command)) return; if (!client.commands.has(command)) return;
try { try {
await client.commands.get(command).execute(client, message, args, config); await client.commands.get(command).parseMessage(client, config, message, args);
} catch (error) { } catch (error) {
console.stack; console.log(error);
message.channel.send({embed: { message.channel.send({
"title": "<:AnitroxError:809651936563429416> **Something went wrong!**", embeds: [{
"description": error.stack, title: '<:AnitroxError:809651936563429416> **Something went wrong!**',
"color": 13632027, description: error.stack,
"footer": { color: 13632027,
"icon_url": message.author.displayAvatarURL(), footer: {
"text": config.footerTxt icon_url: message.author.displayAvatarURL(),
}, text: config.footerTxt
}}); }
}]
});
} }
}); });
client.login(config.token); client.on('interactionCreate', async (interaction) => {
client.commands.get(interaction.commandName).parseInteraction(client, config, interaction);
});
client.login(config.token);