diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..5e2d5fe --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,17 @@ +{ + "env": { + "browser": true, + "commonjs": true, + "es2021": true + }, + "extends": [ + "standard" + ], + "parserOptions": { + "ecmaVersion": "latest" + }, + "rules": { + "no-eval": "off", + "semi": [1, "always"] + } +} diff --git a/commands/8ball.js b/commands/8ball.js index 0a43ce1..81b6ed8 100644 --- a/commands/8ball.js +++ b/commands/8ball.js @@ -1,32 +1,47 @@ +const { Constants } = require('discord.js'); + module.exports = { name: require('path').parse(__filename).name, description: 'Ask Anitrox a question, any question! and they will answer it!', - syntax: ["[Question]"], - - 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(" ") + options: [{ + name: 'question', + description: 'The question to ask Anitrox', + required: true, + type: Constants.ApplicationCommandOptionTypes.STRING + }], - if (!question) { - await message.channel.send(client.generateErrorMessage("You need to ask a question!")); - } else { - await message.channel.send({embed: { - "title": ":8ball: 8Ball", - "description": `Your amazing question: **${question}**`, - "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt + async parseMessage (client, config, message, args) { + await message.channel.send(this.handle(client, config, message.author, args.slice(0).join(' '))); + }, + + async parseInteraction (client, config, interaction) { + await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getString('question'))); + }, + + handle (client, config, user, question) { + 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", - "value": `${answer}` + name: 'Answer', + value: `${answer}` } ] - }}); - } + }] + }; } -} \ No newline at end of file +}; diff --git a/commands/avatar.js b/commands/avatar.js index 615ce63..53d203e 100644 --- a/commands/avatar.js +++ b/commands/avatar.js @@ -1,21 +1,45 @@ +const { Constants } = require('discord.js'); + module.exports = { name: require('path').parse(__filename).name, 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) { - const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author; - - await message.channel.send({embed: { - "title": `:frame_photo: ${user.username}'s Beautiful Avatar!`, - "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt - }, - "image": { - "url": user.displayAvatarURL() - } - }}); + async parseMessage (client, config, message, args) { + 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)); + }, + + async parseInteraction (client, config, interaction) { + const target = interaction.options.getUser('user') || client.users.cache.get(interaction.options.getString('userid')) || interaction.user; + await interaction.reply(this.handle(client, config, interaction.user, target)); + }, + + handle (_, config, user, target) { + return { + embeds: [{ + title: `:frame_photo: ${target.username}'s Beautiful Avatar!`, + color: 9442302, + footer: { + icon_url: user.displayAvatarURL(), + text: config.footerTxt + }, + image: { + url: target.displayAvatarURL() + } + }] + }; } -} +}; diff --git a/commands/bonk.js b/commands/bonk.js index 764fc42..0dff2b4 100644 --- a/commands/bonk.js +++ b/commands/bonk.js @@ -1,26 +1,40 @@ -module.exports = { - - name: require('path').parse(__filename).name, - description: "Bonks a user!", +const { Constants } = require('discord.js'); - async execute(client, message, _, config) { - const taggedUser = message.mentions.users.first(); - - if(!taggedUser) { - await message.channel.send(client.generateErrorMessage("You need to @mention a user!")); - } else { - await message.channel.send({embed: { - "title": " Bonk", - "description": `${taggedUser} You have been bonked by ${message.author}!`, - "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt +module.exports = { + + name: require('path').parse(__filename).name, + description: 'Bonks a user!', + options: [{ + name: 'user', + description: 'The user to bonk', + required: true, + type: Constants.ApplicationCommandOptionTypes.USER + }], + + async parseMessage (client, config, message) { + 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: ' Bonk', + description: `${target} You have been bonked by ${user}!`, + color: 9442302, + footer: { + icon_url: user.displayAvatarURL(), + text: config.footerTxt }, - "image": { - "url": "https://cdn.discordapp.com/attachments/793537380330111028/801194481549312060/HappyBONK.gif" + image: { + url: 'https://cdn.discordapp.com/attachments/793537380330111028/801194481549312060/HappyBONK.gif' } - }}); - } + }] + }; } -} +}; diff --git a/commands/cheese.js b/commands/cheese.js index c3b2f59..38b4f5e 100644 --- a/commands/cheese.js +++ b/commands/cheese.js @@ -1,26 +1,40 @@ +const { Constants } = require('discord.js'); + module.exports = { 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) { - const taggedUser = message.mentions.users.first(); - - if(!taggedUser) { - await message.channel.send("*slams cheese on desk*\n**Cheese.** https://www.youtube.com/watch?v=Or4IE8fkpn4"); - } else { - await message.channel.send({embed: { - "title": ":cheese: Cheesed", - "description": `${taggedUser} You have been cheesed by ${message.author}!`, - "color": 16312092, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt + async parseMessage (client, config, message) { + 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 (_, config, user, target) { + if (!target) return '*slams cheese on desk*\n**Cheese.** https://www.youtube.com/watch?v=Or4IE8fkpn4'; + + return { + embeds: [{ + title: ':cheese: Cheesed', + description: `${target} You have been cheesed by ${user}!`, + color: 16312092, + footer: { + icon_url: user.displayAvatarURL(), + text: config.footerTxt }, - "image": { - "url": "https://cdn.discordapp.com/attachments/803658122299572255/812867714368536636/R06325af354168febcafd96b8328b7590.png" + image: { + url: 'https://cdn.discordapp.com/attachments/803658122299572255/812867714368536636/R06325af354168febcafd96b8328b7590.png' } - }}); - } + }] + }; } -} +}; diff --git a/commands/choose.js b/commands/choose.js index bcba262..cf841b2 100644 --- a/commands/choose.js +++ b/commands/choose.js @@ -1,26 +1,42 @@ +const { Constants } = require('discord.js'); + module.exports = { 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) { - var [head, ...options] = message.content.split(/\s*\n\s*/); + async parseMessage (client, config, message, args) { + let [head, ...options] = message.content.split(/\s*\n\s*/); head = head.slice(this.name.length + config.prefix.length); if (head) options.push(head); + await message.channel.send(this.handle(client, config, message.author, options)); + }, - if (!options.length) { - await message.channel.send(client.generateErrorMessage("You need to provide some input!")); - } else { - const answer = options[Math.floor(Math.random() * options.length)]; - await message.channel.send({embed: { - "title": "I have made my decision:", - "description": answer, - "color": 8311585, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt - }, - }}); - } + async parseInteraction (client, config, interaction) { + console.log([...Array(10).keys()].map(i => interaction.options.getString(`option${i + 1}`)).filter(str => str)); + 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, options) { + if (!options.length) return client.generateErrorMessage('You need to provide some input!', user.displayAvatarURL()); + + const answer = options[Math.floor(Math.random() * options.length)]; + return { + embeds: [{ + title: 'I have made my decision:', + description: answer, + color: 8311585, + footer: { + icon_url: user.displayAvatarURL(), + text: config.footerTxt + } + }] + }; } -} +}; diff --git a/commands/contributors.js b/commands/contributors.js index 44d6deb..9b11355 100644 --- a/commands/contributors.js +++ b/commands/contributors.js @@ -2,33 +2,44 @@ module.exports = { name: require('path').parse(__filename).name, description: 'Attributions to open source components used by Anitrox', - - async execute(_0, message, _1, config){ - await message.channel.send({embed: { - "title": "Contributors", - "description": "Links to check out our contributors!", - "color": 52508, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt - }, - "thumbnail": { - "url": "https://cdn.discordapp.com/emojis/809651812323164192.webp?size=128&quality=lossless" - }, - "fields": [ - { - "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)" + options: [], + + async parseMessage (_, config, message) { + await message.channel.send(this.handle(config, message.author)); + }, + + async parseInteraction (_, config, interaction) { + await interaction.reply(this.handle(config, interaction.user)); + }, + + handle (config, user) { + return { + embeds: [{ + title: 'Contributors', + description: 'Links to check out our contributors!', + color: 52508, + footer: { + icon_url: user.displayAvatarURL(), + text: config.footerTxt }, - { - "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)" + thumbnail: { + url: 'https://cdn.discordapp.com/emojis/809651812323164192.webp?size=128&quality=lossless' }, - { - "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)" - } - ] - }}); + fields: [ + { + 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)' + } + ] + }] + }; } -} \ No newline at end of file +}; diff --git a/commands/cuddle.js b/commands/cuddle.js index 165b3af..bbf5e61 100644 --- a/commands/cuddle.js +++ b/commands/cuddle.js @@ -1,35 +1,48 @@ +const { Constants } = require('discord.js'); + const gifchoices = [ - "https://i.pinimg.com/originals/4d/89/d7/4d89d7f963b41a416ec8a55230dab31b.gif", - "https://media1.tenor.com/images/6d73b0a9cadef5310be4b6160d2f959a/tenor.gif?itemid=12099823", - "https://media.tenor.com/images/2636cf3c8152631b4630bf71757a4afa/tenor.gif", - "https://i.imgur.com/JiFpT5E.gif" + 'https://i.pinimg.com/originals/4d/89/d7/4d89d7f963b41a416ec8a55230dab31b.gif', + 'https://media1.tenor.com/images/6d73b0a9cadef5310be4b6160d2f959a/tenor.gif?itemid=12099823', + 'https://media.tenor.com/images/2636cf3c8152631b4630bf71757a4afa/tenor.gif', + 'https://i.imgur.com/JiFpT5E.gif' ]; module.exports = { 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) { - const taggedUser = message.mentions.users.first(); - const index = Math.floor(Math.random() * gifchoices.length); - const gif = (gifchoices[index]); + async parseMessage (client, config, message) { + await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first())); + }, - if(!taggedUser) { - await message.channel.send(client.generateErrorMessage("You need to @mention a user!")); - } else { - await message.channel.send({embed: { - "title": ":heart: Cuddle", - "description": `${taggedUser} You have been cuddled by ${message.author}!`, - "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt + 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()); + + const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; + return { + embeds: [{ + title: ':heart: Cuddle', + description: `${target} You have been cuddled by ${user}!`, + color: 9442302, + footer: { + icon_url: user.displayAvatarURL(), + text: config.footerTxt }, - "image": { - "url": gif + image: { + url: gif } - }}); - } + }] + }; } -} +}; diff --git a/commands/eval.js b/commands/eval.js index 86b0f18..df12710 100644 --- a/commands/eval.js +++ b/commands/eval.js @@ -1,36 +1,53 @@ -const { inspect } = require("util"); +const { Constants } = require('discord.js'); +const { inspect } = require('util'); module.exports = { - name: require('path').parse(__filename).name, - description: 'Executes JS code', + name: require('path').parse(__filename).name, + description: 'handles JS code', + options: [{ + name: 'code', + description: 'The string to evaluate', + required: true, + type: Constants.ApplicationCommandOptionTypes.STRING + }], - async execute(_, message, args, config) { - if (message.author.id == config.ownerID) { + async parseMessage (client, config, message, args) { + 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 { - const code = args.join(" "); 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) { - await message.channel.send({embed: { - "title": "<:AnitroxError:809651936563429416> **Something went wrong! **", - "color": 13632027, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt - }, - "fields": [ - { - "name": "**What Happened?**", - "value": "The command you tried to run failed to execute due to an error." + return { + embeds: [{ + title: '<:AnitroxError:809651936563429416> **Something went wrong! **', + color: 13632027, + footer: { + icon_url: user.displayAvatarURL(), + text: config.footerTxt }, - { - "name": "Error Info", - "value": error.message - } - ] - }}); + fields: [ + { + name: '**What Happened?**', + value: 'The command you tried to run failed to handle due to an error.' + }, + { + name: 'Error Info', + value: error.message + } + ] + }] + }; } }; } -} +}; diff --git a/commands/help.js b/commands/help.js index e2bd143..99ee3e5 100644 --- a/commands/help.js +++ b/commands/help.js @@ -1,28 +1,38 @@ module.exports = { - + name: require('path').parse(__filename).name, description: 'Get help on anything from commands, to what the bot does! just not your homework..', - syntax: '', + options: [], - async execute(_0, message, _1, config) { - await message.channel.send({embed: { - "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, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": `${config.footerTxt} | No mother it's just the northern lights` - }, - "fields": [ - { - "name": "Command List", - "value": "[Click here!](https://github.com/IDeletedSystem64/anitrox/blob/dev/commands.md)" + async parseMessage (client, config, message) { + await message.channel.send(this.handle(client, config, message.author)); + }, + + async parseInteraction (client, config, interaction) { + await interaction.reply(this.handle(client, config, interaction.user)); + }, + + handle (_, config, user) { + return { + embeds: [{ + 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, + footer: { + icon_url: user.displayAvatarURL(), + text: `${config.footerTxt} | No mother it's just the northern lights` }, - { - "name": "...Or is the bot actually on fire?", - "value": "Join the [support server!](https://discord.gg/grebRGsBZ3)" - } - ] - }}); + fields: [ + { + 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)' + } + ] + }] + }; } -} +}; diff --git a/commands/hug.js b/commands/hug.js index c2eb6c3..b3d2f8e 100644 --- a/commands/hug.js +++ b/commands/hug.js @@ -1,35 +1,49 @@ +const { Constants } = require('discord.js'); + const gifchoices = [ - "https://cdn.discordapp.com/attachments/803658122299572255/807670647920001044/hug2.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/808834617494208532/gif3new.gif", - "https://cdn.discordapp.com/attachments/803658122299572255/807671126376972308/gif4.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/807670951113392178/gif6.gif', + 'https://cdn.discordapp.com/attachments/803658122299572255/808834617494208532/gif3new.gif', + 'https://cdn.discordapp.com/attachments/803658122299572255/807671126376972308/gif4.gif' ]; module.exports = { name: require('path').parse(__filename).name, - description: "Hugs a user!", - - async execute(client, message, _, config) { - const taggedUser = message.mentions.users.first(); - - if(!taggedUser) { - await message.channel.send(client.generateErrorMessage("You need to @mention a user!")); - } else { - const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; - await message.channel.send({embed: { - "title": " Hug", - "description": `${taggedUser} You have been hugged by ${message.author}!`, - "color": 8311585, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt + description: 'Hugs a user!', + options: [{ + name: 'user', + description: 'The user to hug', + required: true, + type: Constants.ApplicationCommandOptionTypes.USER + }], + + async parseMessage (client, config, message) { + 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()); + + const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; + return { + embeds: [{ + title: ' Hug', + description: `${target} You have been hugged by ${user}!`, + color: 8311585, + footer: { + icon_url: user.displayAvatarURL(), + text: config.footerTxt }, - "image": { - "url": gif + image: { + url: gif } - }}); - } + }] + }; } -} +}; diff --git a/commands/info.js b/commands/info.js index 41ce529..36ccdf4 100644 --- a/commands/info.js +++ b/commands/info.js @@ -1,4 +1,4 @@ -function Uptime(uptime) { +function Uptime (uptime) { const totalSeconds = (uptime / 1000); const days = parseInt(totalSeconds / 86400); @@ -6,10 +6,10 @@ function Uptime(uptime) { const minutes = parseInt((totalSeconds % 3600) / 60); const seconds = parseInt(totalSeconds % 60); - 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"); + 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}`; } @@ -18,90 +18,100 @@ module.exports = { name: require('path').parse(__filename).name, description: 'Shows bot and host information', + options: [], - async execute(client, message, _, config) { - const os = require("os"); + async parseMessage (client, config, message) { + 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 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()}` - }, - { - "name": "<:hostos:793866961675223090> OS Type", - "value": `${process.platform} / ${os.version()}` + return { + embeds: [{ + 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 }, - { - "name": "<:node:793537507018145813> Node.JS Version", - "value": process.version + thumbnail: { + url: client.user.displayAvatarURL() }, - { - "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" - } + 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()}` + }, - ] - }}); + { + 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' + } + ] + }] + }; } }; diff --git a/commands/invite.js b/commands/invite.js index a17a2c8..f918bfa 100644 --- a/commands/invite.js +++ b/commands/invite.js @@ -2,34 +2,44 @@ module.exports = { name: require('path').parse(__filename).name, description: 'Add Anitrox to your beautiful server!', - syntax: [], - - async execute(_0, message, _1, config) { - await message.channel.send({embed: { - "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)" - } - ] - }}); + options: [], + + async parseMessage (client, config, message) { + await message.channel.send(this.handle(client, config, message.author)); }, -}; \ No newline at end of file + + 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)' + } + ] + }] + }; + } +}; diff --git a/commands/kiss.js b/commands/kiss.js index da73e95..d3c132a 100644 --- a/commands/kiss.js +++ b/commands/kiss.js @@ -1,35 +1,49 @@ +const { Constants } = require('discord.js'); + const gifchoices = [ - "https://cdn.discordapp.com/attachments/803658122299572255/807671954055626812/kiss5.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/807671971168387082/kiss4.gif", - "https://cdn.discordapp.com/attachments/803658122299572255/807672017217781840/kiss3.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/807671964599713862/kiss1.gif', + 'https://cdn.discordapp.com/attachments/803658122299572255/807671971168387082/kiss4.gif', + 'https://cdn.discordapp.com/attachments/803658122299572255/807672017217781840/kiss3.gif' ]; module.exports = { name: require('path').parse(__filename).name, - description: "Kisses a user!", - - async execute(client, message, _, config) { - const taggedUser = message.mentions.users.first(); - - if(!taggedUser) { - await message.channel.send(client.generateErrorMessage("You need to @mention a user!")); - } else { - const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; - await message.channel.send({embed: { - "title": ":heart: Kiss", - "description": `${taggedUser} You have been kissed by ${message.author}!`, - "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt + description: 'Kisses a user!', + options: [{ + name: 'user', + description: 'The user to kiss', + required: true, + type: Constants.ApplicationCommandOptionTypes.USER + }], + + async parseMessage (client, config, message) { + 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()); + + 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": { - "url": gif + image: { + url: gif } - }}); - } + }] + }; } -} +}; diff --git a/commands/leskiss.js b/commands/leskiss.js index e5003b7..89b34db 100644 --- a/commands/leskiss.js +++ b/commands/leskiss.js @@ -1,45 +1,59 @@ +const { Constants } = require('discord.js'); + const gifchoices = [ - "https://cdn.discordapp.com/attachments/793537380330111028/803833954750038066/gif5.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/803834082034843658/gif18.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/803834132035665950/gif16.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/803834323898990592/gif11.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/803834498714304522/gif15.gif", - "https://cdn.discordapp.com/attachments/793537380330111028/803834514269798460/gif19.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/803834034135236628/gif9.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/803834099869024296/gif10.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/803834249425715210/gif22.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/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/803834514269798460/gif19.gif' ]; module.exports = { - + name: require('path').parse(__filename).name, - description: "Lesbian kiss <:lesbian:803831629428686849>", - - async execute(client, message, _, config) { - const taggedUser = message.mentions.users.first(); - - if(!taggedUser) { - await message.channel.send(client.generateErrorMessage("You need to @mention a user!")); - } else { - const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; - await message.channel.send({embed: { - "title": ":heart: <:lesbian:803831629428686849> Kiss", - "description": `${taggedUser} You have been kissed by ${message.author}!`, - "color": 8311585, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt + description: 'Lesbian kiss <:lesbian:803831629428686849>', + options: [{ + name: 'user', + description: 'The user to kiss', + required: true, + type: Constants.ApplicationCommandOptionTypes.USER + }], + + async parseMessage (client, config, message) { + 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()); + + 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": { - "url": gif + image: { + url: gif } - }}); - } + }] + }; } -} +}; diff --git a/commands/lick.js b/commands/lick.js index cb22eb0..abf6257 100644 --- a/commands/lick.js +++ b/commands/lick.js @@ -1,34 +1,47 @@ +const { Constants } = require('discord.js'); + const gifchoices = [ - "https://cdn.discordapp.com/attachments/803658122299572255/805314244123951114/cef569820773b0f5d54ee34cfa18e1f8.gif", - "https://cdn.lowgif.com/full/2027501b8fa5225c-.gif", - "https://i.gifer.com/36Nx.gif", - "https://media.tenor.com/images/e8bbe712a5f36bbe9545930894b08bf9/tenor.gif" + 'https://cdn.discordapp.com/attachments/803658122299572255/805314244123951114/cef569820773b0f5d54ee34cfa18e1f8.gif', + 'https://cdn.lowgif.com/full/2027501b8fa5225c-.gif', + 'https://i.gifer.com/36Nx.gif', + 'https://media.tenor.com/images/e8bbe712a5f36bbe9545930894b08bf9/tenor.gif' ]; module.exports = { name: require('path').parse(__filename).name, - description: "Licks a user!", - - async execute(client, message, _, config) { - const taggedUser = message.mentions.users.first(); + description: 'Licks a user!', + options: [{ + name: 'user', + description: 'The user to lick', + required: true, + type: Constants.ApplicationCommandOptionTypes.USER + }], - if(!taggedUser) { - await message.channel.send(client.generateErrorMessage("You need to @mention a user!")); - } else { - const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; - await message.channel.send({embed: { - "title": " Lick", - "description": `${taggedUser} You have been licked by ${message.author}!`, - "color": 8311585, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt + async parseMessage (client, config, message) { + 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()); + const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; + return { + embeds: [{ + title: ' Lick', + description: `${target} You have been licked by ${user}!`, + color: 8311585, + footer: { + icon_url: user.displayAvatarURL(), + text: config.footerTxt }, - "image": { - "url": "https://cdn.discordapp.com/attachments/803658122299572255/805314244123951114/cef569820773b0f5d54ee34cfa18e1f8.gif" + image: { + url: gif } - }}); - } + }] + }; } -} +}; diff --git a/commands/nom.js b/commands/nom.js index 049a1cf..c2ea792 100644 --- a/commands/nom.js +++ b/commands/nom.js @@ -1,34 +1,48 @@ +const { Constants } = require('discord.js'); + const gifchoices = [ - "https://i.imgur.com/Ns1RBzX.gif", - "https://cdn.lowgif.com/full/2027501b8fa5225c-.gif", - "https://i.gifer.com/36Nx.gif", - "https://media.tenor.com/images/e8bbe712a5f36bbe9545930894b08bf9/tenor.gif" + 'https://i.imgur.com/Ns1RBzX.gif', + 'https://cdn.lowgif.com/full/2027501b8fa5225c-.gif', + 'https://i.gifer.com/36Nx.gif', + 'https://media.tenor.com/images/e8bbe712a5f36bbe9545930894b08bf9/tenor.gif' ]; module.exports = { name: require('path').parse(__filename).name, - description: "Noms an user!", - - async execute(client, message, _, config) { - const taggedUser = message.mentions.users.first(); + description: 'Noms a user!', + options: [{ + name: 'user', + description: 'The user to nom', + required: true, + type: Constants.ApplicationCommandOptionTypes.USER + }], - if(!taggedUser) { - await message.channel.send(client.generateErrorMessage("You need to @mention a user!")); - } else { - const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; - await message.channel.send({embed: { - "title": "<:BlobNomBlob:801241117919805510> Nom", - "description": `${taggedUser} You have been nommed by ${message.author}!`, - "color": 8311585, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt + async parseMessage (client, config, message) { + 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()); + + 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": { - "url": gif + image: { + url: gif } - }}); - } + }] + }; } -} +}; diff --git a/commands/pat.js b/commands/pat.js index 6c7a072..03baec6 100644 --- a/commands/pat.js +++ b/commands/pat.js @@ -1,33 +1,46 @@ +const { Constants } = require('discord.js'); + const gifchoices = [ - "https://cdn.discordapp.com/attachments/803658122299572255/803708174293008474/tenor.gif", - "https://community.gamepress.gg/uploads/default/original/3X/0/a/0a762099c5ad6de9ca5f13dd22a7e45884a99eb3.gif", - "https://media1.giphy.com/media/ARSp9T7wwxNcs/giphy.gif" + 'https://cdn.discordapp.com/attachments/803658122299572255/803708174293008474/tenor.gif', + 'https://community.gamepress.gg/uploads/default/original/3X/0/a/0a762099c5ad6de9ca5f13dd22a7e45884a99eb3.gif', + 'https://media1.giphy.com/media/ARSp9T7wwxNcs/giphy.gif' ]; module.exports = { name: require('path').parse(__filename).name, - description: "Pats a user!", - - async execute(client, message, _, config) { - const taggedUser = message.mentions.users.first(); - - if(!taggedUser) { - await message.channel.send(client.generateErrorMessage("You need to @mention a user!")); - } else { - const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; - await message.channel.send({embed: { - "title": "<:pats:801238281286713355> Pat", - "description": `${taggedUser} You have been patted by ${message.author}!`, - "color": 8311585, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt + description: 'Pats a user!', + options: [{ + name: 'user', + description: 'The user to pat', + required: true, + type: Constants.ApplicationCommandOptionTypes.USER + }], + + async parseMessage (client, config, message) { + 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()); + 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": { - "url": gif + image: { + url: gif } - }}); - } + }] + }; } -} +}; diff --git a/commands/ping.js b/commands/ping.js index df10b93..ff623e2 100644 --- a/commands/ping.js +++ b/commands/ping.js @@ -1,20 +1,31 @@ module.exports = { name: require('path').parse(__filename).name, - description: "Gets bot ping", - - async execute(client, message, _, 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 **${location}** and got ${client.ws.ping} ms.`, - "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt - } - }}); + description: 'Gets bot ping', + options: [], + + async parseMessage (client, config, message, args) { + await message.channel.send(await this.handle(client, config, message.author)); + }, + + async parseInteraction (client, config, interaction) { + await interaction.reply(await this.handle(client, config, interaction.user)); + }, + + async handle (client, config, user) { + 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 + } + }] + }; } }; diff --git a/commands/poke.js b/commands/poke.js index 92cf989..52a9c3f 100644 --- a/commands/poke.js +++ b/commands/poke.js @@ -1,33 +1,47 @@ +const { Constants } = require('discord.js'); + const gifchoices = [ - "https://i.pinimg.com/originals/b4/95/fb/b495fb19f4b9a1b04f48297b676c497b.gif", - "https://i.imgur.com/H7Ok5tn.gif", - "https://media1.tenor.com/images/8fe23ec8e2c5e44964e5c11983ff6f41/tenor.gif?itemid=5600215" + 'https://i.pinimg.com/originals/b4/95/fb/b495fb19f4b9a1b04f48297b676c497b.gif', + 'https://i.imgur.com/H7Ok5tn.gif', + 'https://media1.tenor.com/images/8fe23ec8e2c5e44964e5c11983ff6f41/tenor.gif?itemid=5600215' ]; module.exports = { name: require('path').parse(__filename).name, - description: "Pokes a user!", - - async execute(client, message, _, config) { - const taggedUser = message.mentions.users.first(); - - if(!taggedUser) { - await message.channel.send(client.generateErrorMessage("You need to @mention a user!")); - } else { - const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; - await message.channel.send({embed: { - "title": "👉 Poke!", - "description": `${taggedUser} You have been poked by ${message.author}!`, - "color": 8311585, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt + description: 'Pokes a user!', + options: [{ + name: 'user', + description: 'The user to poke', + required: true, + type: Constants.ApplicationCommandOptionTypes.USER + }], + + async parseMessage (client, config, message) { + 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()); + + 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": { - "url": gif + image: { + url: gif } - }}); - } + }] + }; } -} +}; diff --git a/commands/reload.js b/commands/reload.js index 05f048d..26daa67 100644 --- a/commands/reload.js +++ b/commands/reload.js @@ -1,50 +1,69 @@ +const { Constants } = require('discord.js'); + module.exports = { - name: require('path').parse(__filename).name, - description: 'Reloads a command', + name: require('path').parse(__filename).name, + 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) => { - const commandName = arg.toLowerCase(); - const command = message.client.commands.get(commandName) - || message.client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName)); + const commandName = arg?.toLowerCase(); + const command = client.commands.get(commandName) || + client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName)); 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 { delete require.cache[require.resolve(`./${command.name}.js`)]; try { const newCommand = require(`./${command.name}.js`); client.commands.set(newCommand.name, newCommand); - await message.channel.send(`<:AnitroxSuccess:809651936819019796> **Reloaded \`${command.name}\` successfully!**`); - console.log(`User reloaded ${command.name}.`) + returnMessage += `Successfully reloaded \`${commandName}\`\n`; + console.log(`User reloaded ${command.name}.`); } catch (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 { - message.channel.send({embed: { - "title": "<:AnitroxDenied:809651936642203668> **403 Forbidden**", - "color": 13632027, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt - }, - "fields": [ - { - "name": "**What Happened?**", - "value": "You don't have the appropriate permissions to run this command!" - } - ] - }}); + return { + embeds: [{ + title: '<:AnitroxDenied:809651936642203668> **403 Forbidden**', + color: 13632027, + footer: { + icon_url: user.displayAvatarURL(), + text: config.footerTxt + }, + fields: [ + { + name: '**What Happened?**', + value: "You don't have the appropriate permissions to run this command!" + } + ] + }] + }; } } -}; \ No newline at end of file +}; diff --git a/commands/restart.js b/commands/restart.js index d048849..e21689a 100644 --- a/commands/restart.js +++ b/commands/restart.js @@ -2,19 +2,28 @@ module.exports = { name: require('path').parse(__filename).name, description: 'Restarts the bot', - - async execute(client, message, _, config) { - if (message.author.id == config.ownerID) { - console.log("Anitrox is restarting now!") - await message.channel.send(" Restarting...") + options: [], + + async parseMessage (client, config, message) { + await message.channel.send(await this.handle(client, config, message.author)); + }, + + 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(' Restarting...'); try { client.destroy(); await client.login(config.token); - await message.channel.send("<:NyabotSuccess:697211376740859914> Restart Successful") - console.log("All systems go") - } catch(e) {console.log(e);} + console.log('All systems go'); + return '<:NyabotSuccess:697211376740859914> Restart Successful'; + } catch (e) { console.error(e); } } 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.'; } } -} +}; diff --git a/commands/setnick.js b/commands/setnick.js index a402423..090fe5a 100644 --- a/commands/setnick.js +++ b/commands/setnick.js @@ -1,37 +1,59 @@ +const { Constants } = require('discord.js'); + module.exports = { name: require('path').parse(__filename).name, description: 'Sets your nickname', + options: [{ + name: 'name', + description: 'The new nickname', + required: true, + type: Constants.ApplicationCommandOptionTypes.STRING + }], - async execute(client, message, args, config) { - if (message.channel.permissionsFor(message.author).has("CHANGE_NICKNAME")) { - 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.") - await message.channel.send({embed: { - "title": "<:AnitroxSuccess:809651936819019796> Nickname Changed", - "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt - }, - "fields": [ - { - "name": "Changed nickname successfully!", - "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?", message.author.displayAvatarURL())); - }; - } else { - await message.channel.send(client.generateErrorMessage("You need to have permission ``CHANGE_NICKNAME`` to change your nick!", message.author.displayAvatarURL())); - } + async parseMessage (client, config, message) { + await message.channel.send(this.handle(client, config, message.author)); + }, + + async parseInteraction (client, config, interaction) { + await interaction.reply(this.handle(client, config, interaction.user)); + }, + + handle (client, config, user, newNick) { + return "Discord has an inbuilt slash command for this, so I think it's best we deprecate this"; + + // const avatarURL = message.author.displayAvatarURL(); + + // if (message.channel.permissionsFor(message.author).has('CHANGE_NICKNAME')) { + // 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."); + // await message.channel.send({ + // embeds: [{ + // title: '<:AnitroxSuccess:809651936819019796> Nickname Changed', + // color: 9442302, + // footer: { + // icon_url: message.author.displayAvatarURL(), + // text: config.footerTxt + // }, + // fields: [ + // { + // name: 'Changed nickname successfully!', + // 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)); + // } } -} +}; diff --git a/commands/slap.js b/commands/slap.js index 6ace9f1..c57ac8c 100644 --- a/commands/slap.js +++ b/commands/slap.js @@ -1,26 +1,39 @@ +const { Constants } = require('discord.js'); + module.exports = { name: require('path').parse(__filename).name, - description: "Slaps an user!", - - async execute(client, message, _, config) { - const taggedUser = message.mentions.users.first(); + description: 'Slaps a user!', + options: [{ + name: 'user', + description: 'The user to slap', + required: true, + type: Constants.ApplicationCommandOptionTypes.USER + }], - if(!taggedUser) { - await message.channel.send(client.generateErrorMessage("You need to @mention a user!")); - } else { - await message.channel.send({embed: { - "title": ":anger: Slap", - "description": `${taggedUser} You have been slapped by ${message.author}!`, - "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt + async parseMessage (client, config, message) { + 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: ':anger: Slap', + description: `${target} You have been slapped by ${user}!`, + color: 9442302, + footer: { + icon_url: user.displayAvatarURL(), + text: config.footerTxt }, - "image": { - "url": "https://media1.tenor.com/images/b6d8a83eb652a30b95e87cf96a21e007/tenor.gif?itemid=10426943" + image: { + url: 'https://media1.tenor.com/images/b6d8a83eb652a30b95e87cf96a21e007/tenor.gif?itemid=10426943' } - }}); - } + }] + }; } -} +}; diff --git a/commands/snuggle.js b/commands/snuggle.js index 8a42b8a..308202b 100644 --- a/commands/snuggle.js +++ b/commands/snuggle.js @@ -1,34 +1,47 @@ -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" -]; +const { Constants } = require('discord.js'); +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 = { name: require('path').parse(__filename).name, - description: "Snuggle an user!", - - async execute(client, message, _, config) { - const taggedUser = message.mentions.users.first(); - - if(!taggedUser) { - await message.channel.send(client.generateErrorMessage("You need to @mention a user!")); - } else { - const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; - await message.channel.send({embed: { - "title": "<:BlobSnuggleCat:806759753450782731> Snuggle", - "description": `${taggedUser} You have been snuggled by ${message.author}!`, - "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt + description: 'Snuggle a user!', + options: [{ + name: 'user', + description: 'The user to snuggle', + required: true, + type: Constants.ApplicationCommandOptionTypes.USER + }], + + async parseMessage (client, config, message) { + 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()); + + 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": { - "url": gif + image: { + url: gif } - }}); - } + }] + }; } -} \ No newline at end of file +}; diff --git a/commands/stop.js b/commands/stop.js index 9e11f13..26bad67 100644 --- a/commands/stop.js +++ b/commands/stop.js @@ -2,30 +2,44 @@ module.exports = { name: require('path').parse(__filename).name, description: "IT'S TIME TO STOP!... the bot", - - async execute(_0, message, _1, config) { - if (message.author.id == config.ownerID) { - await message.channel.send({embed: { - "title": " **Shutting Down...**", - "description": "See you next time!", - "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt - }, - }}); - console.log("The bot is shutting down! Bye bye!") - process.exit(); + options: [], + + async parseMessage (client, config, message) { + await message.channel.send(await this.handle(client, config, message.author)); + process.exit(); + }, + + async parseInteraction (client, config, interaction) { + await interaction.reply(await this.handle(client, config, interaction.user)); + process.exit(); + }, + + async handle (_, config, user) { + if (user.id === config.ownerID) { + console.log('The bot is shutting down! Bye bye!'); + return { + embeds: [{ + title: ' **Shutting Down...**', + description: 'See you next time!', + color: 9442302, + footer: { + icon_url: user.displayAvatarURL(), + text: config.footerTxt + } + }] + }; } else { - await message.channel.send({embed: { - "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": config.footerTxt - }, - }}); + return { + embeds: [{ + title: '<:AnitroxDenied:809651936642203668> 403 Forbidden', + description: 'You need to be the bot owner to execute this command!', + color: 13632027, + footer: { + icon_url: user.displayAvatarURL(), + text: config.footerTxt + } + }] + }; } } -} \ No newline at end of file +}; diff --git a/commands/uinfo.js b/commands/uinfo.js index aa20282..438413a 100644 --- a/commands/uinfo.js +++ b/commands/uinfo.js @@ -1,57 +1,73 @@ +const { Constants } = require('discord.js'); + module.exports = { name: require('path').parse(__filename).name, - description: "Gets info about an user, such as ID, Discord Join date and more", - syntax: "", + description: 'Gets info about an user, such as ID, Discord Join date and more', + options: [{ + name: 'user', + description: 'Another user', + required: false, + type: Constants.ApplicationCommandOptionTypes.USER + }], - async execute(client, message, args, config) { - const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author - - await message.channel.send({embed: { - "title": `Everything you've ever wanted to know about ${user.username}!`, - "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt - }, - "thumbnail": { - "url": user.displayAvatarURL() - }, - "fields": [ - - { - "name": "Username", - "value": user.username, - "inline": true + async parseMessage (client, config, message) { + const target = message.mentions.members.first() || message.member; + await message.channel.send(this.handle(client, config, message.author, target)); + }, + + async parseInteraction (client, config, interaction) { + const target = interaction.options.getUser('user') ? (await interaction.guild.members.fetch(interaction.options.getUser('user'))) : interaction.member; + await interaction.reply(this.handle(client, config, interaction.user, target)); + }, + + handle (client, config, user, target) { + return { + embeds: [{ + title: `Everything you've ever wanted to know about ${target}!`, + color: 9442302, + footer: { + icon_url: user.displayAvatarURL(), + text: config.footerTxt }, - { - "name": "Discriminator", - "value": user.discriminator, - "inline": true + thumbnail: { + url: target.displayAvatarURL() }, - { - "name": "Full Username", - "value": user.tag, - "inline": true - }, - { - "name": "User Profile Picture", - "value": user.displayAvatarURL() - }, - { - "name": "User Status", - value: user.presence.status - }, - { - "name": "User ID", - "value": `\`${user.id}\`` - }, - { - "name": "User Joined Discord", - "value": user.createdAt, - inline: true - }, - ] - }}); + fields: [ + { + name: 'Username', + value: target.user.username, + inline: true + }, + { + name: 'Discriminator', + value: target.user.discriminator, + inline: true + }, + { + name: 'Full Username', + value: target.user.tag, + inline: true + }, + { + name: 'User Profile Picture', + value: target.user.displayAvatarURL() + }, + { + 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 + } + ] + }] + }; } -} +}; diff --git a/config-example.json b/config-example.json index 47afd8f..a89d9ee 100644 --- a/config-example.json +++ b/config-example.json @@ -1,21 +1,27 @@ { - "prefix": "n!", - "token": "IM SO EXCITED ABOUT BURGER", - "ownerID": "MY FAVORITE COLOR IS TWELVE", - "release": "anitrox_dev", - "build": "Stable", - "footerTxt": "Anitrox, made with <3 by IDeletedSystem64 | 2018-2022", - - "statuses": [ - "with np!help", - "with Sophie!", - "Trans Rights!", - "in your computer", - "with my internet router", - "ssh: system64@borkeonv2", - "YouTube", - "with source code", - "Visual Studio Code", + "prefix": "n!", + "token": "IM SO EXCITED ABOUT BURGER", + "ownerID": "MY FAVORITE COLOR IS TWELVE", + "release": "anitrox_dev", + "build": "Stable", + "footerTxt": "Anitrox, made with <3 by IDeletedSystem64 | 2018-2022", + "sandbox": { + "enabled": false, + "id": "788391989460205571", + "refreshLocal": false, + "refreshGlobal": false + }, + + "statuses": [ + "with np!help", + "with Sophie!", + "Trans Rights!", + "in your computer", + "with my internet router", + "ssh: system64@borkeonv2", + "YouTube", + "with source code", + "Visual Studio Code", "Minecraft", "with the network connections.", "VLC Media Player", @@ -53,5 +59,10 @@ "Go for it! :smile:", "Good idea!", "Sure" + ], + "intents": [ + "GUILDS", + "GUILD_MESSAGES", + "GUILD_PRESENCES" ] - } \ No newline at end of file +} \ No newline at end of file diff --git a/package.json b/package.json index 45ac005..74182dd 100644 --- a/package.json +++ b/package.json @@ -4,13 +4,17 @@ "description": "Discord Bot Based on Discord.JS", "main": "start.js", "dependencies": { - "discord.js": "^12.5.1", + "discord.js": "^13.6.0", "node-os-utils": "^1.3.2", "require-all": "^3.0.0" }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, "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" + } } diff --git a/start.js b/start.js index effc033..52af0c7 100755 --- a/start.js +++ b/start.js @@ -3,77 +3,115 @@ const fs = require('fs'); const Discord = require('discord.js'); const config = require('./config.json'); -console.log('Starting!') -const client = new Discord.Client(); +console.log('Starting!'); +const client = new Discord.Client({ intents: config.intents.map(intent => eval(`Discord.Intents.FLAGS.${intent}`)) }); + 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) { - const command = require(`./commands/${file}`); - client.commands.set(command.name, command); -} +client.on('error', (e) => console.log(`[ERROR] ${e}`)); +client.on('warn', (e) => (`[WARN] ${e}`)); +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: { - "title": "<:AnitroxError:809651936563429416> Error", - "color": 13632027, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": config.footerTxt - }, - "fields": [ - { - "name": "Something went wrong!", - "value": errorMsg + if (sandboxSettings.enabled) { + if (sandboxSettings.refreshLocal) { + console.log('deleting previous local commands'); + existingLocal.forEach(async x => { + await localCommands.delete(x); + }); + existingLocal = new Discord.Collection(); } - ] -}}) -client.on("error", (e) => console.log(`[ERROR] ${error(e)}`)); -client.on("warn", (e) => (`[WARN] ${warn(e)}`)); -client.once('ready', () => { - console.clear() + if (sandboxSettings.refreshGlobal) { + console.log('deleting previous global commands'); + existingGlobal.forEach(async x => { + 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(`${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 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); - }); - // Begin Command Handler -client.on('message', async (message) => { - +client.on('messageCreate', async (message) => { if (!message.content.startsWith(config.prefix) || message.author.bot) return; const args = message.content.slice(config.prefix.length).split(/\s+/); const command = args.shift().toLowerCase(); - + if (!client.commands.has(command)) return; try { - await client.commands.get(command).execute(client, message, args, config); + await client.commands.get(command).parseMessage(client, config, message, args); } 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": config.footerTxt - }, - }}); + console.log(error); + message.channel.send({ + embeds: [{ + title: '<:AnitroxError:809651936563429416> **Something went wrong!**', + description: error.stack, + color: 13632027, + footer: { + icon_url: message.author.displayAvatarURL(), + text: config.footerTxt + } + }] + }); } }); -client.login(config.token); \ No newline at end of file +client.on('interactionCreate', async (interaction) => { + client.commands.get(interaction.commandName).parseInteraction(client, config, interaction); +}); + +client.login(config.token);