From 333357e1c91856e443d494558a7acd1796527c49 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Fri, 25 Mar 2022 23:48:29 -0500 Subject: [PATCH 01/22] Allow the user to get info by user ID --- commands/uinfo.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/commands/uinfo.js b/commands/uinfo.js index 0cb944f..7f568c4 100644 --- a/commands/uinfo.js +++ b/commands/uinfo.js @@ -2,10 +2,10 @@ module.exports = { name: "uinfo", description: "Gets info about an user, such as ID, Discord Join date and more", syntax: "", - execute(client, message, args) { - const {footerTxt} = require('../config.json'); - let user = message.mentions.users.first() || args[0] - if (!user) user = message.author + execute(client, message, args, footerTxt) { + console.log(args[0]) + let user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author + // if (!user) user = message.author const embed = { "title": "Everything you've ever wanted to know about " + user.username + "!", "color": 9442302, From 25971ab8cb55f8cfc8b83cfca84f721785df3a69 Mon Sep 17 00:00:00 2001 From: Nathaniel Mason Date: Sat, 26 Mar 2022 08:33:18 +0000 Subject: [PATCH 02/22] Foxi's initial patches + formatting updates --- commands/8ball.js | 116 ++++++++++++------------ commands/avatar.js | 40 ++++----- commands/bonk.js | 54 ++++++----- commands/cheese.js | 50 +++++------ commands/cuddle.js | 65 +++++++------- commands/eval.js | 64 +++++++------ commands/help.js | 14 +-- commands/hug.js | 93 +++++++++---------- commands/info.js | 198 ++++++++++++++++++++--------------------- commands/invite.js | 59 ++++++------ commands/kiss.js | 79 +++++++--------- commands/leskiss.js | 79 +++++++--------- commands/lick.js | 86 ++++++++---------- commands/nom.js | 97 +++++++++----------- commands/opensource.js | 61 ++++++------- commands/pat.js | 73 +++++++-------- commands/ping.js | 30 +++---- commands/poke.js | 75 +++++++--------- commands/reload.js | 75 ++++++++-------- commands/restart.js | 32 +++---- commands/setnick.js | 95 ++++++++++---------- commands/slap.js | 79 ++++++++-------- commands/snuggle.js | 67 ++++++++------ commands/stop.js | 58 ++++++------ commands/uinfo.js | 15 ++-- config-example.json | 37 -------- start.js | 23 +++-- 27 files changed, 849 insertions(+), 965 deletions(-) delete mode 100644 config-example.json mode change 100644 => 100755 start.js diff --git a/commands/8ball.js b/commands/8ball.js index 499359b..664e557 100644 --- a/commands/8ball.js +++ b/commands/8ball.js @@ -1,62 +1,62 @@ -module.exports = { - name: '8ball', - description: 'Ask Anitrox a question, any question! and they will answer it!', - syntax: ["[Question]"], - execute(client, message, args) { - const {footerTxt} = require('../config.json'); - const answers = [ - "Heck no!", - "Are you crazy!? No!", - "Don't even think about it.", - "No! You might bork something!", - "Heck yeah", - "I don't think so.", - "Let me think about it first. No.", - "Let me think about it first. Yeah", - "Let me think about it first. Maybe", - "I don't know man", - "Maybe", - "I'm not sure", - "Ask again", - "YEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE!!!", - "Definitely!", - "Go for it! :smile:", - "Good idea!", - "Sure" - ] - const index = Object.keys(answers)[Math.floor(Math.random() * Object.keys(answers).length)]; - var question = args.slice(0).join(" ") - var answer = (answers[index]); - console.log(args); +const { MessageEmbed } = require('discord.js'); - if (!question) { - const embed = { - "title": "<:AnitroxError:809651936563429416> **Something went wrong!**", - "description": "You need to ask a", - "color": 13632027, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - } - } +const answers = [ + "Heck no!", + "Are you crazy!? No!", + "Don't even think about it.", + "No! You might bork something!", + "Heck yeah", + "I don't think so.", + "Let me think about it first. No.", + "Let me think about it first. Yeah", + "Let me think about it first. Maybe", + "I don't know man", + "Maybe", + "I'm not sure", + "Ask again", + "YEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE!!!", + "Definitely!", + "Go for it! :smile:", + "Good idea!", + "Sure" +] + +module.exports = { + name: '8ball', + description: 'Ask Anitrox a question, any question! and they will answer it!', + syntax: ["[Question]"], + async execute(_, message, args, footerTxt) { + const answer = answers[Math.floor(Math.random() * Object.keys(answers).length)]; + const question = args.slice(0).join(" ") + console.log(args); + + if (!question) { + await message.channel.send(new MessageEmbed({ + "title": "<:AnitroxError:809651936563429416> **Something went wrong!**", + "description": "You need to ask a question!", + "color": 13632027, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt } - const embed = { - "title": ":8ball: Anitrox 8 Ball", - "description": "Your question: **" + question + "**", - "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, - - "fields": [ - { - "name": "🤔 My Answer", - "value": answer - } - ] - }; - message.channel.send({ embed }); - + })); + } else { + await message.channel.send(new MessageEmbed({ + "title": ":8ball: Anitrox 8 Ball", + "description": "Your question: **" + question + "**", + "color": 9442302, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, + + "fields": [ + { + "name": "🤔 My Answer", + "value": answer + } + ] + })); } + } } \ No newline at end of file diff --git a/commands/avatar.js b/commands/avatar.js index 3741e6e..3b1f1a7 100644 --- a/commands/avatar.js +++ b/commands/avatar.js @@ -1,23 +1,23 @@ +const { MessageEmbed } = require('discord.js'); + module.exports = { - name: "avatar", - description: "Gets a users avatar.", - execute(client, message, args) { - user = message.mentions.users.first() - if (!user) user = message.author + + name: "avatar", + description: "Gets a user's avatar.", + async execute(_0, message, _1, footerTxt) { + + const user = message.mentions.users.first() || message.author; - const {footerTxt} = require('../config.json'); - - const embed = { - "title": ":frame_photo: " + user.username + "'s Beautiful Avatar!", - "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, - "image": { - "url": user.displayAvatarURL() - } - }; - message.channel.send({ embed }); - } + await message.channel.send(new MessageEmbed({ + "title": ":frame_photo: " + user.username + "'s Beautiful Avatar!", + "color": 9442302, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, + "image": { + "url": user.displayAvatarURL() + } + })); + } } diff --git a/commands/bonk.js b/commands/bonk.js index 99da59f..613b253 100644 --- a/commands/bonk.js +++ b/commands/bonk.js @@ -1,11 +1,14 @@ +const { MessageEmbed } = require("discord.js"); + module.exports = { - name: "bonk", - description: "Bonks an user!", - execute(client, message, args) { - const taggedUser = message.mentions.users.first(); - const {footerTxt} = require('../config.json'); - const errorembed = { + name: "bonk", + description: "Bonks a user!", + async execute(_0, message, _1, footerTxt) { + const taggedUser = message.mentions.users.first(); + + if(!taggedUser) { + await message.channel.send(new MessageEmbed({ "title": "<:AnitroxError:809651936563429416> Error", "color": 13632027, "footer": { @@ -18,27 +21,20 @@ module.exports = { "value": "You need to @mention an user!" } ] - }; - - if(!taggedUser) { - return message.channel.send({ embed: errorembed}); - // Checks if a user was mentioned. If not, returns error message. - } - - const embed = { - "title": " Bonk", - "description": "<@" + taggedUser + ">" + " You have been bonked by <@" + message.author + ">!", - "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, - "image": { - "url": "https://cdn.discordapp.com/attachments/793537380330111028/801194481549312060/HappyBONK.gif" - } - } - - - message.channel.send({ embed: embed }); - } + })); + } else { + await message.channel.send(new MessageEmbed({ + "title": " Bonk", + "description": "<@" + taggedUser + ">" + " You have been bonked by <@" + message.author + ">!", + "color": 9442302, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, + "image": { + "url": "https://cdn.discordapp.com/attachments/793537380330111028/801194481549312060/HappyBONK.gif" + } + })); } + } +} diff --git a/commands/cheese.js b/commands/cheese.js index 76aae42..d4c007f 100644 --- a/commands/cheese.js +++ b/commands/cheese.js @@ -1,31 +1,25 @@ +const { MessageEmbed } = require("discord.js"); + module.exports = { -//a - name: "cheese", - description: "Cheese an user, or run just ``n!cheese`` for a surprise :eyes:", - execute(client, message, args) { - const taggedUser = message.mentions.users.first(); - const {footerTxt} = require('../config.json'); - + name: "cheese", + description: "Cheese an user, or run just ``n!cheese`` for a surprise :eyes:", + async execute(_0, message, _1, footerTxt) { + const taggedUser = message.mentions.users.first(); if(!taggedUser) { - return message.channel.send("*slams cheese on desk* Cheese. https://www.youtube.com/watch?v=Or4IE8fkpn4"); - - } - - - const embed = { - "title": ":cheese: Cheesed", - "description": "<@" + taggedUser + ">" + " You got cheesed by " + "<@" + message.author + ">!", - "color": 16312092, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, - "image": { - "url": "https://cdn.discordapp.com/attachments/803658122299572255/812867714368536636/R06325af354168febcafd96b8328b7590.png" - } - } - - - message.channel.send({ embed: embed }); - } + await message.channel.send("*slams cheese on desk* Cheese. https://www.youtube.com/watch?v=Or4IE8fkpn4"); + } else { + await message.channel.send(new MessageEmbed({ + "title": ":cheese: Cheesed", + "description": "<@" + taggedUser + ">" + " You got cheesed by " + "<@" + message.author + ">!", + "color": 16312092, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, + "image": { + "url": "https://cdn.discordapp.com/attachments/803658122299572255/812867714368536636/R06325af354168febcafd96b8328b7590.png" + } + })); } + } +} diff --git a/commands/cuddle.js b/commands/cuddle.js index b518f31..6896a40 100644 --- a/commands/cuddle.js +++ b/commands/cuddle.js @@ -1,38 +1,37 @@ +const { MessageEmbed } = 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" +]; + module.exports = { - name: "cuddle", - description: "Cuddle an user!", - execute(client, message, args) { - const taggedUser = message.mentions.users.first(); - const {footerTxt} = require('../config.json'); - // -------------------------------------- - 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" - ]; - const index = Math.floor(Math.random() * (gifchoices.length - 1) + 1); - var gif = (gifchoices[index]); - // --------------------------------------- + name: "cuddle", + description: "Cuddle an user!", + async execute(_0, message, _1, footerTxt) { - if(!taggedUser) { - return message.channel.send("<:AnitroxError:809651936563429416> You need to specify an user!") - } - const embed = { - "title": ":heart: Cuddle", - "description": "<@" + taggedUser + ">" + " You have been cuddled by " + "<@" + message.author + ">!", - "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, - "image": { - "url": gif - } - } + const taggedUser = message.mentions.users.first(); + const index = Math.floor(Math.random() * gifchoices.length); + const gif = (gifchoices[index]); - - message.channel.send({ embed: embed }); - } + if(!taggedUser) { + await message.channel.send("<:AnitroxError:809651936563429416> You need to specify an user!"); + } else { + await message.channel.send(new MessageEmbed({ + "title": ":heart: Cuddle", + "description": "<@" + taggedUser + ">" + " You have been cuddled by " + "<@" + message.author + ">!", + "color": 9442302, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, + "image": { + "url": gif + } + })); } + } +} diff --git a/commands/eval.js b/commands/eval.js index 8d3eb19..f4c1b0b 100644 --- a/commands/eval.js +++ b/commands/eval.js @@ -1,40 +1,36 @@ +const { MessageEmbed } = require("discord.js"); +const { inspect } = require("util"); module.exports = { name: 'eval', description: 'Runs js code', - execute(client, message, args) { - const commandName = args[0].toLowerCase(); - if (message.author.id == 309427567004483586) { - try { - const code = args.join(" "); - let evaled = eval(code); - - if (typeof evaled !== "string") - evaled = require("util").inspect(evaled); - - message.channel.send(clean(evaled), {code:"xl"}); - } catch (error) { - const embed = { - "title": "<:NyabotError:697145462347661412> **Well that happened...**", - "color": 13632027, - "footer": { - "icon_url": "https://cdn.discordapp.com/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": "Anitrox © IDeletedSystem64 2018-2021 All Rights Reserved." - }, - "fields": [ - { - "name": "**What Happened?**", - "value": "The command you tried to run failed to execute due to an error." - }, - { - "name": "Error Info", - "value": error.message - } - ] - }; - message.channel.send({ embed }); - } -}; - } + async execute(_, message, args, footerTxt) { + if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { + try { + const code = args.join(" "); + const evaled = inspect(eval(code)); + await message.channel.send(evaled, {code:"xl"}); + } catch (error) { + await message.channel.send(new MessageEmbed({ + "title": "<:NyabotError:697145462347661412> **Well that happened...**", + "color": 13632027, + "footer": { + "icon_url": "https://images-ext-2.discordapp.net/external/-qaO3jaZLojhEnjrHiKABdXD7gLWqFvdUqHdskNGWhE/https/media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", + "text": footerTxt + }, + "fields": [ + { + "name": "**What Happened?**", + "value": "The command you tried to run failed to execute due to an error." + }, + { + "name": "Error Info", + "value": error.message + } + ] + })); + } + }; + } } diff --git a/commands/help.js b/commands/help.js index bed475e..747478e 100644 --- a/commands/help.js +++ b/commands/help.js @@ -1,13 +1,13 @@ +const { MessageEmbed } = require("discord.js"); + module.exports = { name: 'help', description: 'Get help on anything from commands, to what the bot does! just not your homework..', syntax: '', - execute(client, message, args) { - const {footerTxt} = require('../config.json'); - - const Embed = { + async execute(_0, message, _1, footerTxt) { + await message.channel.send(new MessageEmbed({ "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, @@ -25,6 +25,6 @@ module.exports = { "value": "Join the [support server!](https://discord.gg/grebRGsBZ3)" } ] - }; - message.channel.send({ embed: Embed }); -}}; \ No newline at end of file + })); + } +} diff --git a/commands/hug.js b/commands/hug.js index 4c17632..acb1a8f 100644 --- a/commands/hug.js +++ b/commands/hug.js @@ -1,54 +1,49 @@ +const { MessageEmbed } = 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" +]; + module.exports = { - name: "hug", - description: "Hugs an user!", - execute(client, message, args) { - const {footerTxt} = require('../config.json'); - const taggedUser = message.mentions.users.first(); - 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" - ]; - //--------------------------------- - const errorembed = { - "title": "<:AnitroxError:809651936563429416> Error", - "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": message.author.displayAvatarURL() - }, - "fields": [ - { - "name": "Well that happened...", - "value": "You need to @mention an user!" - } - ] - }; - + name: "hug", + description: "Hugs a user!", + async execute(_0, message, _1, footerTxt) { + const taggedUser = message.mentions.users.first(); + if(!taggedUser) { - return message.channel.send({ embed: errorembed}); - // Checks if a user was mentioned. If not, returns error message. - } - - const index = Math.floor(Math.random() * (gifchoices.length - 1) + 0.4); - var gif = (gifchoices[index]); - const embed = { - "title": " Hug", - "description": "<@" + taggedUser + ">" + " You have been hugged by " + "<@" + message.author + ">!", - "color": 8311585, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, - "image": { - "url": gif - } + await message.channel.send(new MessageEmbed({ + "title": "<:AnitroxError:809651936563429416> Error", + "color": 9442302, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": message.author.displayAvatarURL() + }, + "fields": [ + { + "name": "Well that happened...", + "value": "You need to @mention an user!" } - - - message.channel.send({ embed: embed }); - } + ] + })); + } else { + const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; + await message.channel.send(new MessageEmbed({ + "title": " Hug", + "description": "<@" + taggedUser + ">" + " You have been hugged by " + "<@" + message.author + ">!", + "color": 8311585, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, + "image": { + "url": gif + } + })); } + } +} diff --git a/commands/info.js b/commands/info.js index 648adcd..88be741 100644 --- a/commands/info.js +++ b/commands/info.js @@ -1,113 +1,109 @@ -const { Client, ClientUser } = require('discord.js'); +const { MessageEmbed } = require('discord.js'); +const {build, release} = require('../config.json'); module.exports = { name: 'info', description: 'Shows bot and host information', - execute(client, message, args) { - const { build, release, footerTxt } = require('../config.json'); - function Uptime(uptimetype) { - let totalSeconds = (uptimetype / 1000); + async execute(client, message, _, footerTxt) { - let days = parseInt(Math.floor(totalSeconds / 86400)) + " day"; - let hours = Math.floor(parseInt(Math.floor(totalSeconds / 3600)) % 24) + " hour"; - totalSeconds %= 3600; - let minutes = parseInt(Math.floor(totalSeconds / 60)) + " minute"; - let seconds = parseInt(totalSeconds % 60) + " second"; + function Uptime(uptime) { + const totalSeconds = (uptime / 1000); - if (parseInt(days.substring(0,2)) != 1) days += "s"; - if (parseInt(hours.substring(0,3)) != 1) hours += "s"; - if (parseInt(minutes.substring(0,3)) != 1) minutes += "s"; - if (parseInt(seconds.substring(0,3)) != 1) seconds += "s"; + const days = parseInt(totalSeconds / 86400); + const hours = parseInt((totalSeconds % 86400) / 3600); + const minutes = parseInt((totalSeconds % 3600) / 60); + const seconds = parseInt(totalSeconds % 60); - let uptime = `${days}**, **${hours}**, **${minutes}**, **${seconds}`; - return uptime; - }; + const daystring = days + (days === 1 ? "day" : "days"); + const hourstring = hours + (hours === 1 ? "day" : "days"); + const minutetring = minutes + (minutes === 1 ? "day" : "days"); + const secondstring = seconds + (seconds === 1 ? "day" : "days"); - const os = require("os") - var osu = require('node-os-utils') - var cpu = osu.cpu - let botAvatar = client.user.displayAvatarURL() - const 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": footerTxt - }, - "thumbnail": { - "url": client.user.displayAvatarURL() - }, - "fields": [ - { - "name": "Bot Information", - "value": "** **" - }, - { - "name": "Release Type", - "value": release, - "inline": true - }, - { - "name": "Release Version", - "value": build, - "inline": true - }, - { - "name": "Uptime", - "value": Uptime(client.uptime), - "inline": true - }, - { - "name": "<:memory:793536677737136178> Bot Memory Usage", - "value": (Math.round(process.memoryUsage().heapUsed / 1024 / 1024 * 100) / 100) + " 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 `${daystring}**, **${hourstring}**, **${minutetring}**, **${secondstring}`; + } - { - "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": "<:usersuccess:793885338250641469> **Special Thanks To**", - "value": "@OfficialTCGMatt for providing help with development\n @chuu_shi Allowing me to host Anitrox on his server" - } - - ] - }; - message.channel.send({ embed }); + const os = require("os"); + const osu = require('node-os-utils'); + const cpu = osu.cpu; + await message.channel.send(new MessageEmbed({ + "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": footerTxt + }, + "thumbnail": { + "url": client.user.displayAvatarURL() + }, + "fields": [ + { + "name": "Bot Information", + "value": "** **" + }, + { + "name": "Release Type", + "value": release, + "inline": true + }, + { + "name": "Release Version", + "value": build, + "inline": true + }, + { + "name": "Uptime", + "value": Uptime(client.uptime), + "inline": true + }, + { + "name": "<:memory:793536677737136178> Bot Memory Usage", + "value": (Math.round(process.memoryUsage().heapUsed / 1024 / 1024 * 100) / 100) + " 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": "<:usersuccess:793885338250641469> **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 d2d184a..08bcd58 100644 --- a/commands/invite.js +++ b/commands/invite.js @@ -1,38 +1,37 @@ +const { MessageEmbed } = require("discord.js"); module.exports = { - + name: 'invite', description: 'Add Anitrox to your beautiful server!', syntax: [], - execute(client, message) { - const {footerTxt} = require('../config.json'); - const 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": 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 execute(_0, message, _1, footerTxt) { + await message.channel.send(new MessageEmbed({ + "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": 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)" + } - ] - }; - message.channel.send({ embed }); + ] + })); }, }; \ No newline at end of file diff --git a/commands/kiss.js b/commands/kiss.js index e4b8fca..eb5c159 100644 --- a/commands/kiss.js +++ b/commands/kiss.js @@ -1,24 +1,22 @@ +const { MessageEmbed } = 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" +]; + module.exports = { - name: "kiss", - description: "Kisses an user!", - execute(client, message, args) { - const {footerTxt} = require('../config.json'); - const taggedUser = message.mentions.users.first(); - - - // -------------------------------------- - 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" - ]; - const index = Math.floor(Math.random() * (gifchoices.length - 1) + 1); - var gif = (gifchoices[index]); - // --------------------------------------- - const errorembed = { + name: "kiss", + description: "Kisses a user!", + async execute(_0, message, _1, footerTxt) { + const taggedUser = message.mentions.users.first(); + + if(!taggedUser) { + await message.channel.send(new MessageEmbed({ "title": "<:AnitroxError:809651936563429416> Error", "color": 13632027, "footer": { @@ -31,30 +29,21 @@ module.exports = { "value": "You need to @mention an user!" } ] - }; - - if(!taggedUser) { - return message.channel.send({ embed: errorembed}); - } - - if(!taggedUser) { - return message.channel.send({ embed: errorembed}); - // Checks if a user was mentioned. If not, returns error message. - } - const embed = { - "title": ":heart: Kiss", - "description": "<@" + taggedUser + ">" + ", You have been kissed by <@" + messageAuthor + ">!", - "color": 9442302, - "footer": { - "icon_url": "https://media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": "Made with ❤ in Illinois | Anitrox © IDeletedSystem64 2018-2021" - }, - "image": { - "url": gif - } - } - - - message.channel.send({ embed: embed }); - } + })); + } else { + const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; + await message.channel.send(new MessageEmbed({ + "title": ":heart: Kiss", + "description": "<@" + taggedUser + ">" + ", You have been kissed by <@" + message.author + ">!", + "color": 9442302, + "footer": { + "icon_url": "https://media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", + "text": "Made with ❤ in Illinois | Anitrox © IDeletedSystem64 2018-2021" + }, + "image": { + "url": gif + } + })); } + } +} diff --git a/commands/leskiss.js b/commands/leskiss.js index a94c328..57c3735 100644 --- a/commands/leskiss.js +++ b/commands/leskiss.js @@ -1,36 +1,32 @@ -const { Message } = require("discord.js"); -const { execute } = require("./info"); +const { MessageEmbed } = 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" +]; module.exports = { - name: "leskiss", - description: "Lesbian kiss <:lesbian:803831629428686849>", - execute(client, message, args) { - const taggedUser = message.mentions.users.first(); - const {footerTxt} = require('../config.json'); - // -------------------------------------- - 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" - - ]; - const index = Math.floor(Math.random() * (gifchoices.length - 1) + 1.75); - var gif = (gifchoices[index]); - // --------------------------------------- - const errorembed = { + name: "leskiss", + description: "Lesbian kiss <:lesbian:803831629428686849>", + async execute(_0, message, _1, footerTxt) { + const taggedUser = message.mentions.users.first(); + + if(!taggedUser) { + await message.channel.send(new MessageEmbed({ "title": "<:AnitroxError:809651936563429416> Error", "color": 9442302, "footer": { @@ -43,17 +39,12 @@ module.exports = { "value": "You need to @mention an user!" } ] - }; - - if(!taggedUser) { - return message.channel.send({ embed: errorembed}); - // Checks if a user was mentioned. If not, returns error message. - } - - - const embed = { + })); + } else { + const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; + await message.channel.send(new MessageEmbed({ "title": ":heart: <:lesbian:803831629428686849> Kiss", - "description": "<@" + taggedUser + ">" + " You have been kissed by <@" + messageAuthor + ">! <:lesbian:803831629428686849>", + "description": "<@" + taggedUser + ">" + " You have been kissed by <@" + message.author + ">! <:lesbian:803831629428686849>", "color": 8311585, "footer": { "icon_url": "https://media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", @@ -62,9 +53,7 @@ module.exports = { "image": { "url": gif } - } - - - message.channel.send({ embed: embed }); - } + })); + } + } } diff --git a/commands/lick.js b/commands/lick.js index 7d10aef..01ebbd9 100644 --- a/commands/lick.js +++ b/commands/lick.js @@ -1,58 +1,48 @@ -module.exports = { +const { MessageEmbed, Message } = require("discord.js"); - name: "lick", - description: "Licks an user!", - execute(client, message, args) { - const {footerTxt} = require('../config.json'); - const taggedUser = message.mentions.users.first(); -//--------------------------------------------------- - // -------------------------------------- - const gifchoices = [ +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" - - ]; -const index = Math.floor(Math.random() * (gifchoices.length - 1) + 1); -var gif = (gifchoices[index]); -// --------------------------------------- -//--------------------------------------------------- -const errorembed = { - "title": "<:AnitroxError:809651936563429416> Error", - "color": 9442302, - "footer": { - "icon_url": "https://images-ext-2.discordapp.net/external/-qaO3jaZLojhEnjrHiKABdXD7gLWqFvdUqHdskNGWhE/https/media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": "Made with ❤ in Illinois | Anitrox © 2018-2021 IDeletedSystem64" - }, - "fields": [ - { - "name": "Well that happened...", - "value": "You need to @mention an user!" - } - ] -}; -if(!taggedUser) { - return message.channel.send({ embed: errorembed}); -// Checks if a user was mentioned. If not, returns error message. -} +module.exports = { - const embed = { - "title": " Lick", - "description": "<@" + taggedUser + "> You have been licked by <@" + message.author + ">!", - "color": 8311585, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, - "image": { - "url": "https://cdn.discordapp.com/attachments/803658122299572255/805314244123951114/cef569820773b0f5d54ee34cfa18e1f8.gif" - } + name: "lick", + description: "Licks an user!", + async execute(_0, message, _1, footerTxt) { + const taggedUser = message.mentions.users.first(); + + if(!taggedUser) { + await message.channel.send(new MessageEmbed({ + "title": "<:AnitroxError:809651936563429416> Error", + "color": 9442302, + "footer": { + "icon_url": "https://images-ext-2.discordapp.net/external/-qaO3jaZLojhEnjrHiKABdXD7gLWqFvdUqHdskNGWhE/https/media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", + "text": "Made with ❤ in Illinois | Anitrox © 2018-2021 IDeletedSystem64" + }, + "fields": [ + { + "name": "Well that happened...", + "value": "You need to @mention an user!" } - - - message.channel.send({ embed: embed }); - } + ] + })); + } else { + const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; + await message.channel.send(new MessageEmbed({ + "title": " Lick", + "description": "<@" + taggedUser + "> You have been licked by <@" + message.author + ">!", + "color": 8311585, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, + "image": { + "url": "https://cdn.discordapp.com/attachments/803658122299572255/805314244123951114/cef569820773b0f5d54ee34cfa18e1f8.gif" + } + })); } + } +} diff --git a/commands/nom.js b/commands/nom.js index d77eddd..96b6975 100644 --- a/commands/nom.js +++ b/commands/nom.js @@ -1,57 +1,48 @@ +const { MessageEmbed } = 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" +]; + module.exports = { - name: "nom", - description: "Noms an user!", - execute(client, message, args) { - const {footerTxt} = require('../config.json'); - const taggedUser = message.mentions.users.first(); - - // -------------------------------------- - 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" - - - ]; - const index = Math.floor(Math.random() * (gifchoices.length - 1) + 1); - var gif = (gifchoices[index]); - // --------------------------------------- - const errorembed = { - "title": "<:AnitroxError:809651936563429416> Error", - "color": 9442302, - "footer": { - "icon_url": "https://images-ext-2.discordapp.net/external/-qaO3jaZLojhEnjrHiKABdXD7gLWqFvdUqHdskNGWhE/https/media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": "Made with ❤ in Illinois | Anitrox by IDeletedSystem64" - }, - "fields": [ - { - "name": "Well that happened...", - "value": "You need to @mention an user!" - } - ] - }; - - if(!taggedUser) { - return message.channel.send({ embed: errorembed}); - // Checks if a user was mentioned. If not, returns error message. - } - - const embed = { - "title": "<:BlobNomBlob:801241117919805510> Nom", - "description": "<@" + taggedUser + "> You have been nommed by <@" + messageAuthor + ">!", - "color": 8311585, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, - "image": { - "url": gif - } + name: "nom", + description: "Noms an user!", + async execute(_0, message, _1, footerTxt) { + const taggedUser = message.mentions.users.first(); + + if(!taggedUser) { + await message.channel.send(new MessageEmbed({ + "title": "<:AnitroxError:809651936563429416> Error", + "color": 9442302, + "footer": { + "icon_url": "https://images-ext-2.discordapp.net/external/-qaO3jaZLojhEnjrHiKABdXD7gLWqFvdUqHdskNGWhE/https/media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", + "text": "Made with ❤ in Illinois | Anitrox by IDeletedSystem64" + }, + "fields": [ + { + "name": "Well that happened...", + "value": "You need to @mention an user!" } - - - message.channel.send({ embed: embed }); - } + ] + })); + } else { + const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; + await message.channel.send(new MessageEmbed({ + "title": "<:BlobNomBlob:801241117919805510> Nom", + "description": "<@" + taggedUser + "> You have been nommed by <@" + messageAuthor + ">!", + "color": 8311585, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, + "image": { + "url": gif + } + })); } + } +} diff --git a/commands/opensource.js b/commands/opensource.js index 342558d..8a5fe3f 100644 --- a/commands/opensource.js +++ b/commands/opensource.js @@ -1,33 +1,34 @@ +const { MessageEmbed } = require("discord.js"); + module.exports = { name: 'opensource', description: 'Attributions to open source components used by Anitrox', - execute(client, message, args){ - const {footerTxt} = require('../config.json'); - const embed = { - "title": "Component Attribution", - "description": "Some parts of Anitrox are using open source code, and their attributions are avaliable here!", - "color": 52508, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, - "thumbnail": { - "url": "https://cdn.discordapp.com/attachments/803658122299572255/838854256471703602/793885335498522685.png" - }, - "fields": [ - { - "name": "Discord.JS", - "value": "[Check out the Discord.JS project on GitHub](https://github.com/discordjs/discord.js/)" - }, - { - "name": "The Anitrox Project", - "value": "[Check out Anitrox on GitHub](https://github.com/IDeletedSystem64/anitrox)" - }, - { - "name": "You", - "value": "Using and supporting the Anitrox Project, thank you! ❤" - } - ] - }; - message.channel.send({ embed }); - }} \ No newline at end of file + async execute(_0, message, _1, footerTxt){ + await message.channel.send(new MessageEmbed({ + "title": "Component Attribution", + "description": "Some parts of Anitrox are using open source code, and their attributions are avaliable here!", + "color": 52508, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, + "thumbnail": { + "url": "https://cdn.discordapp.com/attachments/803658122299572255/838854256471703602/793885335498522685.png" + }, + "fields": [ + { + "name": "Discord.JS", + "value": "[Check out the Discord.JS project on GitHub](https://github.com/discordjs/discord.js/)" + }, + { + "name": "The Anitrox Project", + "value": "[Check out Anitrox on GitHub](https://github.com/IDeletedSystem64/anitrox)" + }, + { + "name": "You", + "value": "Using and supporting the Anitrox Project, thank you! ❤" + } + ] + })); + } +} \ No newline at end of file diff --git a/commands/pat.js b/commands/pat.js index adc8ee8..6a6fb66 100644 --- a/commands/pat.js +++ b/commands/pat.js @@ -1,23 +1,20 @@ +const { MessageEmbed } = 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" +]; + module.exports = { - name: "pat", - description: "Pats an user!", - execute(client, message, args) { - const {footerTxt} = require('../config.json'); - const taggedUser = message.mentions.users.first(); - - // -------------------------------------- - 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" - - - ]; - const index = Math.floor(Math.random() * (gifchoices.length - 1) + 2); - var gif = (gifchoices[index]); - // --------------------------------------- - const errorembed = { + name: "pat", + description: "Pats a user!", + async execute(_0, message, _1, footerTxt) { + const taggedUser = message.mentions.users.first(); + + if(!taggedUser) { + await message.channel.send(new MessageEmbed({ "title": "<:AnitroxError:809651936563429416> Error", "color": 9442302, "footer": { @@ -30,27 +27,21 @@ module.exports = { "value": "You need to @mention an user!" } ] - }; - - if(!taggedUser) { - return message.channel.send({ embed: errorembed}); - // Checks if a user was mentioned. If not, returns error message. - } - - const embed = { - "title": "<:pats:801238281286713355> Pat", - "description": "<@" + taggedUser + "> You have been patted by <@" + messageAuthor + ">!", - "color": 8311585, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, - "image": { - "url": gif - } - } - - - message.channel.send({ embed: embed }); - } + })); + } else { + const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; + await message.channel.send(new MessageEmbed({ + "title": "<:pats:801238281286713355> Pat", + "description": "<@" + taggedUser + "> You have been patted by <@" + messageAuthor + ">!", + "color": 8311585, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, + "image": { + "url": gif + } + })); } + } +} diff --git a/commands/ping.js b/commands/ping.js index bfd0020..f1923a4 100644 --- a/commands/ping.js +++ b/commands/ping.js @@ -1,21 +1,21 @@ +const { MessageEmbed } = require('discord.js'); +const { locations } = require('../config.json'); + module.exports = { name: "ping", description: "Gets bot ping", - execute(client, message) { - const {footerTxt, locations} = require('../config.json'); + async execute(client, message, _, footerTxt) { + const index = Math.floor(Math.random() * locations.length); + const pingLocation = locations[index] - const index = Math.floor(Math.random() * (locations.length -1 ) + 1); - PingLocation = locations[index] - const embed = { - "title": ":ping_pong: Ping", - "description": "**Pong!** We pinged **" + PingLocation + "** and got " + client.ws.ping + " ms.", - "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - } -} - - message.channel.send({ embed }); + await message.channel.send(new MessageEmbed({ + "title": ":ping_pong: Ping", + "description": "**Pong!** We pinged **" + pingLocation + "** and got " + client.ws.ping + " ms.", + "color": 9442302, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + } + })); } }; diff --git a/commands/poke.js b/commands/poke.js index d9a1fd5..4f961ce 100644 --- a/commands/poke.js +++ b/commands/poke.js @@ -1,23 +1,20 @@ +const { MessageEmbed } = 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" +]; + module.exports = { - name: "poke", - description: "Pokes an user!", - execute(client, message, args) { - const messageAuthor = message.author - const taggedUser = message.mentions.users.first(); - - // -------------------------------------- - 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" - - - ]; - const index = Math.floor(Math.random() * (gifchoices.length - 1) + 2); - var gif = (gifchoices[index]); - // --------------------------------------- - const errorembed = { + name: "poke", + description: "Pokes an user!", + async execute(_0, message, _1, footerTxt) { + const taggedUser = message.mentions.users.first(); + + if(!taggedUser) { + await message.channel.send(new MessageEmbed({ "title": "<:AnitroxError:809651936563429416> Error", "color": 9442302, "footer": { @@ -30,27 +27,21 @@ module.exports = { "value": "You need to @mention an user!" } ] - }; - - if(!taggedUser) { - return message.channel.send({ embed: errorembed}); - // Checks if a user was mentioned. If not, returns error message. - } - - const embed = { - "title": "👉 Poke!", - "description": "<@" + taggedUser + "> You have been poked by <@" + messageAuthor + ">!", - "color": 8311585, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, - "image": { - "url": gif - } - } - - - message.channel.send({ embed: embed }); - } - } + })); + } else { + const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; + await message.channel.send(new MessageEmbed({ + "title": "👉 Poke!", + "description": "<@" + taggedUser + "> You have been poked by <@" + message.author + ">!", + "color": 8311585, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, + "image": { + "url": gif + } + })); + } + } +} diff --git a/commands/reload.js b/commands/reload.js index 59af0ac..36360d9 100644 --- a/commands/reload.js +++ b/commands/reload.js @@ -1,44 +1,45 @@ +const { MessageEmbed } = require("discord.js"); + module.exports = { name: 'reload', description: 'Reloads a command', args: true, - execute(client, message, args, denied) { - if (message.author.id == 309427567004483586) { - const commandName = args[0].toLowerCase(); - const command = message.client.commands.get(commandName) - || message.client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName)); + async execute(client, message, args, footerTxt) { + if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { + const commandName = args[0].toLowerCase(); + const command = message.client.commands.get(commandName) + || message.client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName)); - if (!command) { - return message.channel.send(`There is no command with name or alias \`${commandName}\`, ${message.author}!`); + if (!command) { + await message.channel.send(`There is no command with name or alias \`${commandName}\`, ${message.author}!`); + } 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(`<:NyabotSuccess:697211376740859914> **Reloaded \`${command.name}\` successfully!**`); + console.log(`User reloaded ${command.name}.`) + } catch (error) { + console.error(error); + await message.channel.send(`<:AnitroxError:809651936563429416> There was an error while reloading \`${command.name}\`:\n\`${error.message}\``); + } + } + } else { + message.channel.send(new MessageEmbed({ + "title": "<:NyabotDenied:697145462565896194> **Access is denied**", + "color": 13632027, + "footer": { + "icon_url": "https://cdn.discordapp.com/attachments/549707869138714635/793524910172667964/Screenshot_26.png", + "text": footerTxt + }, + "fields": [ + { + "name": "**What Happened?**", + "value": "You don't have the appropriate permissions to run this command!" + } + ] + })); } - - delete require.cache[require.resolve(`./${command.name}.js`)]; - - try { - const newCommand = require(`./${command.name}.js`); - message.client.commands.set(newCommand.name, newCommand); - message.channel.send(`<:NyabotSuccess:697211376740859914> **Reloaded \`${command.name}\` successfully!**`); - console.log('User reloaded ${command.name}.') - } catch (error) { - console.error(error); - message.channel.send(`<:AnitroxError:809651936563429416> There was an error while reloading \`${command.name}\`:\n\`${error.message}\``); - } - } else { - const embed = { - "title": "<:NyabotDenied:697145462565896194> **Access is denied**", - "color": 13632027, - "footer": { - "icon_url": "https://cdn.discordapp.com/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": "Made with ❤ in Illinois | Anitrox by IDeletedSystem64" - }, - "fields": [ - { - "name": "**What Happened?**", - "value": "You don't have the appropriate permissions to run this command!" - } - ] - }; - message.channel.send({ embed }); - } - }, + } }; \ No newline at end of file diff --git a/commands/restart.js b/commands/restart.js index 009cc4a..38d1228 100644 --- a/commands/restart.js +++ b/commands/restart.js @@ -1,18 +1,20 @@ +const { token } = require('../config.json'); +const Discord = require('discord.js'); module.exports = { - name: 'restart', - description: '(Owner Only) Shuts down the bot.', - execute(client, message, args) { - const { token } = require('../config.json'); - if (message.author.id == 309427567004483586) { - message.channel.send(" Restarting...").then - client.destroy() - .catch(console.error) - .then - setTimeout(() => { client.login(token); }, 3000); - message.channel.send("<:NyabotSuccess:697211376740859914> Restart Successful") + name: 'restart', + description: '(Owner Only) Shuts down the bot.', + async execute(client, message, args) { + if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { + await message.channel.send(" Restarting...") + try { + client.destroy(); + await client.login(token); + await message.channel.send("<:NyabotSuccess:697211376740859914> Restart Successful") console.log("All systems go") - } else { - message.channel.send("<:NyabotDenied:697145462565896194> Access Denied, You must be bot owner to execute this command."); - } - }} + } catch(e) {console.log(e);} + } else { + await message.channel.send("<:NyabotDenied:697145462565896194> Access Denied, You must be bot owner to execute this command."); + } + } +} diff --git a/commands/setnick.js b/commands/setnick.js index a828250..dac383e 100644 --- a/commands/setnick.js +++ b/commands/setnick.js @@ -1,49 +1,50 @@ -module.exports = { - name: 'setnick', - description: 'Sets your nickname', - execute(client, message, args) { - - if (message.channel.permissionsFor(message.author).has("CHANGE_NICKNAME")) { - var newnick = args.slice(0).join(" ") +const { MessageEmbed } = require("discord.js"); - try { - const successembed = { - "title": "<:AnitroxSuccess:809651936819019796> Nickname Changed", - "color": 9442302, - "footer": { - "icon_url": "https://images-ext-2.discordapp.net/external/-qaO3jaZLojhEnjrHiKABdXD7gLWqFvdUqHdskNGWhE/https/media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": "Made with ❤ in Illinois | Anitrox by IDeletedSystem64" - }, - "fields": [ - { - "name": "Changed nickname successfully!", - "value": "You need to have permission ``CHANGE_NICKNAME`` to change your nick!" - }, - { - "name": "New Nickname", - "value": newnick, - "inline": true - } - ] - }; - 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.") - message.channel.send({ embed: successembed }); - } catch (error) { - const failembed = { - "title": "<:AnitroxDenied:809651936642203668> Well that happened...", - "color": 13632027, - "footer": { - "icon_url": "https://cdn.discordapp.com/embed/avatars/0.png", - "text": "Made with ❤ in Illinois | Anitrox © 2018-2021 IDeletedSystem64" - }, - "fields": [ - { - "name": "Failed to set nickname", - "value": "You need to have permission ``CHANGE_NICKNAME`` to change your nick!" - } - ] - }; - message.channel.send({ embed: failembed }); - }; +module.exports = { + name: 'setnick', + description: 'Sets your nickname', + async execute(_, message, args, footerTxt) { + + 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(new MessageEmbed({ + "title": "<:AnitroxSuccess:809651936819019796> Nickname Changed", + "color": 9442302, + "footer": { + "icon_url": "https://images-ext-2.discordapp.net/external/-qaO3jaZLojhEnjrHiKABdXD7gLWqFvdUqHdskNGWhE/https/media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", + "text": footerTxt + }, + "fields": [ + { + "name": "Changed nickname successfully!", + "value": "You need to have permission ``CHANGE_NICKNAME`` to change your nick!" + }, + { + "name": "New Nickname", + "value": newnick, + "inline": true + } + ] + })); + } catch (error) { + await message.channel.send(new MessageEmbed({ + "title": "<:AnitroxDenied:809651936642203668> Well that happened...", + "color": 13632027, + "footer": { + "icon_url": "https://cdn.discordapp.com/embed/avatars/0.png", + "text": footerTxt + }, + "fields": [ + { + "name": "Failed to set nickname", + "value": "You need to have permission ``CHANGE_NICKNAME`` to change your nick!" + } + ] + })); + }; }; -}} + } +} diff --git a/commands/slap.js b/commands/slap.js index 106e0af..44aee4d 100644 --- a/commands/slap.js +++ b/commands/slap.js @@ -1,47 +1,40 @@ +const { MessageEmbed } = require("discord.js"); + module.exports = { - name: "slap", - description: "Slaps an user!", - execute(client, message, args) { - const {footerTxt} = require('../config.json'); - const taggedUser = message.mentions.users.first(); -//--------------------------------------------------- + name: "slap", + description: "Slaps an user!", + async execute(_0, message, _1, footerTxt) { + const taggedUser = message.mentions.users.first(); -//--------------------------------------------------- -const errorembed = { - "title": "<:AnitroxError:809651936563429416> Error", - "color": 13632027, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, - "fields": [ - { - "name": "Well that happened...", - "value": "You need to @mention an user!" - } - ] -}; - -if(!taggedUser) { - return message.channel.send({ embed: errorembed}); -// Checks if a user was mentioned. If not, returns error message. -} - - const embed = { - "title": ":anger: Slap", - "description": "<@" + taggedUser + "> You have been slapped by <@" + messageAuthor + ">!", - "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, - "image": { - "url": "https://media1.tenor.com/images/b6d8a83eb652a30b95e87cf96a21e007/tenor.gif?itemid=10426943" - } + if(!taggedUser) { + await message.channel.send(new MessageEmbed({ + "title": "<:AnitroxError:809651936563429416> Error", + "color": 13632027, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, + "fields": [ + { + "name": "Well that happened...", + "value": "You need to @mention an user!" } - - - message.channel.send({ embed: embed }); - } - } + ] + })); + } else { + await message.channel.send(new MessageEmbed({ + "title": ":anger: Slap", + "description": "<@" + taggedUser + "> You have been slapped by <@" + messageAuthor + ">!", + "color": 9442302, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, + "image": { + "url": "https://media1.tenor.com/images/b6d8a83eb652a30b95e87cf96a21e007/tenor.gif?itemid=10426943" + } + })); + } + } +} diff --git a/commands/snuggle.js b/commands/snuggle.js index 583219c..ab58a1f 100644 --- a/commands/snuggle.js +++ b/commands/snuggle.js @@ -1,36 +1,47 @@ +const { MessageEmbed } = 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: "snuggle", description: "Snuggle an user!", - execute(client, message, args) { - const {footerTxt} = require('../config.json'); + async execute(_0, message, _1, footerTxt) { const taggedUser = message.mentions.users.first(); - // -------------------------------------- - 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 index = Math.floor(Math.random() * (gifchoices.length - 1) + 1); - var gif = (gifchoices[index]); - // --------------------------------------- - - const embed = { - "title": "<:BlobSnuggleCat:806759753450782731> Snuggle", - "description": "<@" + taggedUser + ">" + " You have been snuggled by " + "<@" + messageAuthor + ">!", - "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, - "image": { - "url": gif + if(!taggedUser) { + await message.channel.send(new MessageEmbed({ + "title": "<:AnitroxError:809651936563429416> Error", + "color": 13632027, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, + "fields": [ + { + "name": "Well that happened...", + "value": "You need to @mention an user!" } + ] + })); + } else { + await message.channel.send(new MessageEmbed({ + "title": "<:BlobSnuggleCat:806759753450782731> Snuggle", + "description": "<@" + taggedUser + ">" + " You have been snuggled by " + "<@" + messageAuthor + ">!", + "color": 9442302, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, + "image": { + "url": gif } - - - message.channel.send({ embed: embed }); - } - } \ No newline at end of file + })); + } + } +} \ No newline at end of file diff --git a/commands/stop.js b/commands/stop.js index 7b3fe5f..5251e0a 100644 --- a/commands/stop.js +++ b/commands/stop.js @@ -1,32 +1,30 @@ +const { MessageEmbed } = require("discord.js"); + module.exports = { - name: "stop", - description: "Stops the bot", - execute(client, message, args) { - if (message.author.id == 309427567004483586) { - const embed = { - "title": " **Shutting Down...**", - "description": "See you next time!", - "color": 9442302, - "footer": { - "icon_url": "https://media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": "Made with ❤ in Illinois | Anitrox © 2018-2021 IDeletedSystem64" - } - }; - message.channel.send({ embed }); - setTimeout(function(){ - client.destroy() - }, 5000); - } else { - const denied = { - "title": ":AnitroxDenied: Access Denied", - "description": "You need to be the bot owner to execute this command!", - "color": 13632027, - "footer": { - "icon_url": "https://media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": "Made with ❤ in Illinois | Anitrox © 2018-2021 IDeletedSystem64" - } - }; - message.channel.send({ denied }); - } + name: "stop", + description: "Stops the bot", + async execute(client, message, _, footerTxt) { + if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { + await message.channel.send(new MessageEmbed({ + "title": " **Shutting Down...**", + "description": "See you next time!", + "color": 9442302, + "footer": { + "icon_url": "https://media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", + "text": footerTxt } - } \ No newline at end of file + })); + client.destroy(); + } else { + await message.channel.send(new MessageEmbed({ + "title": ":AnitroxDenied: Access Denied", + "description": "You need to be the bot owner to execute this command!", + "color": 13632027, + "footer": { + "icon_url": "https://media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", + "text": footerTxt + } + })); + } + } +} \ No newline at end of file diff --git a/commands/uinfo.js b/commands/uinfo.js index 7f568c4..b1cb7dc 100644 --- a/commands/uinfo.js +++ b/commands/uinfo.js @@ -1,19 +1,19 @@ +const { MessageEmbed } = require("discord.js"); + module.exports = { name: "uinfo", description: "Gets info about an user, such as ID, Discord Join date and more", syntax: "", - execute(client, message, args, footerTxt) { + async execute(client, message, args, footerTxt) { console.log(args[0]) - let user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author - // if (!user) user = message.author - const embed = { + const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author + await message.channel.send(new MessageEmbed({ "title": "Everything you've ever wanted to know about " + user.username + "!", "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), "text": footerTxt }, - "thumbnail": { "url": user.displayAvatarURL() }, @@ -52,7 +52,6 @@ module.exports = { inline: true }, ] - }; - message.channel.send({ embed: embed }); - } + })); } +} diff --git a/config-example.json b/config-example.json deleted file mode 100644 index b6e2ed2..0000000 --- a/config-example.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "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", - "Minecraft", - "with the network connections.", - "VLC Media Player", - "Chromium" -], -"locations": [ -"Microsoft", -"LinusTechTips", -"Linus Torvalds", -"borkeonv2", -"Google", -"192.168.1.1", -"127.0.0.1", -"Sophie's computer", -"Mars", -"Elon Musk", -"TMC Software" -] -} \ No newline at end of file diff --git a/start.js b/start.js old mode 100644 new mode 100755 index 3c3169f..11694bf --- a/start.js +++ b/start.js @@ -1,8 +1,8 @@ +#!/usr/bin/env -S node + const fs = require('fs'); const Discord = require('discord.js'); -const { MessageActionRow, MessageButton } = require('discord.js') const { statuses, build, release, prefix, token, footerTxt } = require('./config.json'); -const os = require("os"); console.log('Starting!') const client = new Discord.Client(); @@ -29,27 +29,28 @@ client.once('ready', () => { console.log("All Systems Go. | Anitrox by IDeletedSystem64 | ALL MY CODE KEEPS BLOWING UP!"); }); + setInterval(() => { - const index = Math.floor(Math.random() * (statuses.length - 1) + 1); + // Picks a status from the config file + const index = Math.floor(Math.random() * statuses.length); client.user.setActivity(statuses[index]); }, 20000); -// Picks a status from the config file // Begin Command Handler -client.on('message', message => { +client.on('message', async (message) => { if (!message.content.startsWith(prefix) || message.author.bot) return; + const args = message.content.slice(prefix.length).split(/ +/); const command = args.shift().toLowerCase(); if (!client.commands.has(command)) return; try { - client.commands.get(command).execute(client, message, args, footerTxt, Discord); + await client.commands.get(command).execute(client, message, args, footerTxt); } catch (error) { - console.stack - const usr = message.author; - const embed = { + console.stack; + message.channel.send(new Discord.MessageEmbed({ "title": "<:AnitroxError:809651936563429416> **Something went wrong!**", "description": error.stack, "color": 13632027, @@ -57,9 +58,7 @@ client.on('message', message => { "icon_url": message.author.displayAvatarURL(), "text": footerTxt + " | Something went wrong! :(" } - }; - message.channel.send({ embed }); -// End Command Handler + })); } }); From 6c10d32fd52c7c1acce20b9b48f28466c962a4c0 Mon Sep 17 00:00:00 2001 From: Nathaniel Mason Date: Sat, 26 Mar 2022 08:58:15 +0000 Subject: [PATCH 03/22] slightly nicer handling of the embed's footer --- commands/8ball.js | 13 +++---------- commands/avatar.js | 9 +++------ commands/bonk.js | 7 ++----- commands/cheese.js | 7 ++----- commands/cuddle.js | 7 ++----- commands/eval.js | 7 ++----- commands/help.js | 7 ++----- commands/hug.js | 7 ++----- commands/info.js | 7 ++----- commands/invite.js | 8 ++------ commands/kiss.js | 12 +++--------- commands/leskiss.js | 12 +++--------- commands/lick.js | 12 +++--------- commands/nom.js | 12 +++--------- commands/opensource.js | 7 ++----- commands/pat.js | 12 +++--------- commands/ping.js | 7 ++----- commands/poke.js | 12 +++--------- commands/reload.js | 7 ++----- commands/restart.js | 3 +-- commands/setnick.js | 12 +++--------- commands/slap.js | 12 +++--------- commands/snuggle.js | 12 +++--------- commands/stop.js | 12 +++--------- commands/uinfo.js | 7 ++----- start.js | 13 +++++++------ 26 files changed, 68 insertions(+), 175 deletions(-) diff --git a/commands/8ball.js b/commands/8ball.js index 664e557..b06b971 100644 --- a/commands/8ball.js +++ b/commands/8ball.js @@ -25,7 +25,7 @@ module.exports = { name: '8ball', description: 'Ask Anitrox a question, any question! and they will answer it!', syntax: ["[Question]"], - async execute(_, message, args, footerTxt) { + async execute(_, message, args, footer) { const answer = answers[Math.floor(Math.random() * Object.keys(answers).length)]; const question = args.slice(0).join(" ") console.log(args); @@ -35,21 +35,14 @@ module.exports = { "title": "<:AnitroxError:809651936563429416> **Something went wrong!**", "description": "You need to ask a question!", "color": 13632027, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - } + "footer": footer })); } else { await message.channel.send(new MessageEmbed({ "title": ":8ball: Anitrox 8 Ball", "description": "Your question: **" + question + "**", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, - + "footer": footer, "fields": [ { "name": "🤔 My Answer", diff --git a/commands/avatar.js b/commands/avatar.js index 3b1f1a7..7d4ab07 100644 --- a/commands/avatar.js +++ b/commands/avatar.js @@ -1,20 +1,17 @@ const { MessageEmbed } = require('discord.js'); module.exports = { - + name: "avatar", description: "Gets a user's avatar.", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const user = message.mentions.users.first() || message.author; await message.channel.send(new MessageEmbed({ "title": ":frame_photo: " + user.username + "'s Beautiful Avatar!", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "image": { "url": user.displayAvatarURL() } diff --git a/commands/bonk.js b/commands/bonk.js index 613b253..cd7b524 100644 --- a/commands/bonk.js +++ b/commands/bonk.js @@ -4,7 +4,7 @@ module.exports = { name: "bonk", description: "Bonks a user!", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -27,10 +27,7 @@ module.exports = { "title": " Bonk", "description": "<@" + taggedUser + ">" + " You have been bonked by <@" + message.author + ">!", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "image": { "url": "https://cdn.discordapp.com/attachments/793537380330111028/801194481549312060/HappyBONK.gif" } diff --git a/commands/cheese.js b/commands/cheese.js index d4c007f..f6cd89e 100644 --- a/commands/cheese.js +++ b/commands/cheese.js @@ -3,7 +3,7 @@ const { MessageEmbed } = require("discord.js"); module.exports = { name: "cheese", description: "Cheese an user, or run just ``n!cheese`` for a surprise :eyes:", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { await message.channel.send("*slams cheese on desk* Cheese. https://www.youtube.com/watch?v=Or4IE8fkpn4"); @@ -12,10 +12,7 @@ module.exports = { "title": ":cheese: Cheesed", "description": "<@" + taggedUser + ">" + " You got cheesed by " + "<@" + message.author + ">!", "color": 16312092, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "image": { "url": "https://cdn.discordapp.com/attachments/803658122299572255/812867714368536636/R06325af354168febcafd96b8328b7590.png" } diff --git a/commands/cuddle.js b/commands/cuddle.js index 6896a40..0eec8d3 100644 --- a/commands/cuddle.js +++ b/commands/cuddle.js @@ -11,7 +11,7 @@ module.exports = { name: "cuddle", description: "Cuddle an user!", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); const index = Math.floor(Math.random() * gifchoices.length); @@ -24,10 +24,7 @@ module.exports = { "title": ":heart: Cuddle", "description": "<@" + taggedUser + ">" + " You have been cuddled by " + "<@" + message.author + ">!", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "image": { "url": gif } diff --git a/commands/eval.js b/commands/eval.js index f4c1b0b..543e340 100644 --- a/commands/eval.js +++ b/commands/eval.js @@ -5,7 +5,7 @@ module.exports = { name: 'eval', description: 'Runs js code', - async execute(_, message, args, footerTxt) { + async execute(_, message, args, footer) { if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { try { const code = args.join(" "); @@ -15,10 +15,7 @@ module.exports = { await message.channel.send(new MessageEmbed({ "title": "<:NyabotError:697145462347661412> **Well that happened...**", "color": 13632027, - "footer": { - "icon_url": "https://images-ext-2.discordapp.net/external/-qaO3jaZLojhEnjrHiKABdXD7gLWqFvdUqHdskNGWhE/https/media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": footerTxt - }, + "footer": footer, "fields": [ { "name": "**What Happened?**", diff --git a/commands/help.js b/commands/help.js index 747478e..465e857 100644 --- a/commands/help.js +++ b/commands/help.js @@ -6,15 +6,12 @@ module.exports = { description: 'Get help on anything from commands, to what the bot does! just not your homework..', syntax: '', - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { await message.channel.send(new MessageEmbed({ "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": footerTxt + " | No mother it's just the northern lights" - }, + "footer": footer, "fields": [ { "name": "Command List", diff --git a/commands/hug.js b/commands/hug.js index acb1a8f..5934d0f 100644 --- a/commands/hug.js +++ b/commands/hug.js @@ -12,7 +12,7 @@ module.exports = { name: "hug", description: "Hugs a user!", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -36,10 +36,7 @@ module.exports = { "title": " Hug", "description": "<@" + taggedUser + ">" + " You have been hugged by " + "<@" + message.author + ">!", "color": 8311585, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "image": { "url": gif } diff --git a/commands/info.js b/commands/info.js index 88be741..3a249bb 100644 --- a/commands/info.js +++ b/commands/info.js @@ -5,7 +5,7 @@ module.exports = { name: 'info', description: 'Shows bot and host information', - async execute(client, message, _, footerTxt) { + async execute(client, message, _, footer) { function Uptime(uptime) { const totalSeconds = (uptime / 1000); @@ -30,10 +30,7 @@ module.exports = { "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": footerTxt - }, + "footer": footer, "thumbnail": { "url": client.user.displayAvatarURL() }, diff --git a/commands/invite.js b/commands/invite.js index 08bcd58..72aabdd 100644 --- a/commands/invite.js +++ b/commands/invite.js @@ -5,15 +5,12 @@ module.exports = { name: 'invite', description: 'Add Anitrox to your beautiful server!', syntax: [], - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { await message.channel.send(new MessageEmbed({ "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": footerTxt - }, + "footer": footer, "thumbnail": { "url": "https://cdn.discordapp.com/attachments/803658122299572255/814352905394061322/anitroxaddsrvr.png" }, @@ -30,7 +27,6 @@ module.exports = { "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 eb5c159..7f8b6e0 100644 --- a/commands/kiss.js +++ b/commands/kiss.js @@ -12,17 +12,14 @@ module.exports = { name: "kiss", description: "Kisses a user!", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { await message.channel.send(new MessageEmbed({ "title": "<:AnitroxError:809651936563429416> Error", "color": 13632027, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "fields": [ { "name": "Well that happened...", @@ -36,10 +33,7 @@ module.exports = { "title": ":heart: Kiss", "description": "<@" + taggedUser + ">" + ", You have been kissed by <@" + message.author + ">!", "color": 9442302, - "footer": { - "icon_url": "https://media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": "Made with ❤ in Illinois | Anitrox © IDeletedSystem64 2018-2021" - }, + "footer": footer, "image": { "url": gif } diff --git a/commands/leskiss.js b/commands/leskiss.js index 57c3735..b257ce0 100644 --- a/commands/leskiss.js +++ b/commands/leskiss.js @@ -22,17 +22,14 @@ module.exports = { name: "leskiss", description: "Lesbian kiss <:lesbian:803831629428686849>", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { await message.channel.send(new MessageEmbed({ "title": "<:AnitroxError:809651936563429416> Error", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "fields": [ { "name": "Well that happened...", @@ -46,10 +43,7 @@ module.exports = { "title": ":heart: <:lesbian:803831629428686849> Kiss", "description": "<@" + taggedUser + ">" + " You have been kissed by <@" + message.author + ">! <:lesbian:803831629428686849>", "color": 8311585, - "footer": { - "icon_url": "https://media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": "Made with ❤ in Illinois | Anitrox © IDeletedSystem64 2018-2021" - }, + "footer": footer, "image": { "url": gif } diff --git a/commands/lick.js b/commands/lick.js index 01ebbd9..907ce3b 100644 --- a/commands/lick.js +++ b/commands/lick.js @@ -11,17 +11,14 @@ module.exports = { name: "lick", description: "Licks an user!", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { await message.channel.send(new MessageEmbed({ "title": "<:AnitroxError:809651936563429416> Error", "color": 9442302, - "footer": { - "icon_url": "https://images-ext-2.discordapp.net/external/-qaO3jaZLojhEnjrHiKABdXD7gLWqFvdUqHdskNGWhE/https/media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": "Made with ❤ in Illinois | Anitrox © 2018-2021 IDeletedSystem64" - }, + "footer": footer, "fields": [ { "name": "Well that happened...", @@ -35,10 +32,7 @@ module.exports = { "title": " Lick", "description": "<@" + taggedUser + "> You have been licked by <@" + message.author + ">!", "color": 8311585, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "image": { "url": "https://cdn.discordapp.com/attachments/803658122299572255/805314244123951114/cef569820773b0f5d54ee34cfa18e1f8.gif" } diff --git a/commands/nom.js b/commands/nom.js index 96b6975..fe862dc 100644 --- a/commands/nom.js +++ b/commands/nom.js @@ -11,17 +11,14 @@ module.exports = { name: "nom", description: "Noms an user!", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { await message.channel.send(new MessageEmbed({ "title": "<:AnitroxError:809651936563429416> Error", "color": 9442302, - "footer": { - "icon_url": "https://images-ext-2.discordapp.net/external/-qaO3jaZLojhEnjrHiKABdXD7gLWqFvdUqHdskNGWhE/https/media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": "Made with ❤ in Illinois | Anitrox by IDeletedSystem64" - }, + "footer": footer, "fields": [ { "name": "Well that happened...", @@ -35,10 +32,7 @@ module.exports = { "title": "<:BlobNomBlob:801241117919805510> Nom", "description": "<@" + taggedUser + "> You have been nommed by <@" + messageAuthor + ">!", "color": 8311585, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "image": { "url": gif } diff --git a/commands/opensource.js b/commands/opensource.js index 8a5fe3f..096128a 100644 --- a/commands/opensource.js +++ b/commands/opensource.js @@ -3,15 +3,12 @@ const { MessageEmbed } = require("discord.js"); module.exports = { name: 'opensource', description: 'Attributions to open source components used by Anitrox', - async execute(_0, message, _1, footerTxt){ + async execute(_0, message, _1, footer){ await message.channel.send(new MessageEmbed({ "title": "Component Attribution", "description": "Some parts of Anitrox are using open source code, and their attributions are avaliable here!", "color": 52508, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "thumbnail": { "url": "https://cdn.discordapp.com/attachments/803658122299572255/838854256471703602/793885335498522685.png" }, diff --git a/commands/pat.js b/commands/pat.js index 6a6fb66..cc1ab0b 100644 --- a/commands/pat.js +++ b/commands/pat.js @@ -10,17 +10,14 @@ module.exports = { name: "pat", description: "Pats a user!", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { await message.channel.send(new MessageEmbed({ "title": "<:AnitroxError:809651936563429416> Error", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "fields": [ { "name": "Well that happened...", @@ -34,10 +31,7 @@ module.exports = { "title": "<:pats:801238281286713355> Pat", "description": "<@" + taggedUser + "> You have been patted by <@" + messageAuthor + ">!", "color": 8311585, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "image": { "url": gif } diff --git a/commands/ping.js b/commands/ping.js index f1923a4..6e46014 100644 --- a/commands/ping.js +++ b/commands/ping.js @@ -4,7 +4,7 @@ const { locations } = require('../config.json'); module.exports = { name: "ping", description: "Gets bot ping", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, footer) { const index = Math.floor(Math.random() * locations.length); const pingLocation = locations[index] @@ -12,10 +12,7 @@ module.exports = { "title": ":ping_pong: Ping", "description": "**Pong!** We pinged **" + pingLocation + "** and got " + client.ws.ping + " ms.", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - } + "footer": footer })); } }; diff --git a/commands/poke.js b/commands/poke.js index 4f961ce..ee133b7 100644 --- a/commands/poke.js +++ b/commands/poke.js @@ -10,17 +10,14 @@ module.exports = { name: "poke", description: "Pokes an user!", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { await message.channel.send(new MessageEmbed({ "title": "<:AnitroxError:809651936563429416> Error", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "fields": [ { "name": "Well that happened...", @@ -34,10 +31,7 @@ module.exports = { "title": "👉 Poke!", "description": "<@" + taggedUser + "> You have been poked by <@" + message.author + ">!", "color": 8311585, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "image": { "url": gif } diff --git a/commands/reload.js b/commands/reload.js index 36360d9..a9c9754 100644 --- a/commands/reload.js +++ b/commands/reload.js @@ -4,7 +4,7 @@ module.exports = { name: 'reload', description: 'Reloads a command', args: true, - async execute(client, message, args, footerTxt) { + async execute(client, message, args, footer) { if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { const commandName = args[0].toLowerCase(); const command = message.client.commands.get(commandName) @@ -29,10 +29,7 @@ module.exports = { message.channel.send(new MessageEmbed({ "title": "<:NyabotDenied:697145462565896194> **Access is denied**", "color": 13632027, - "footer": { - "icon_url": "https://cdn.discordapp.com/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": footerTxt - }, + "footer": footer, "fields": [ { "name": "**What Happened?**", diff --git a/commands/restart.js b/commands/restart.js index 38d1228..2cd54c2 100644 --- a/commands/restart.js +++ b/commands/restart.js @@ -1,10 +1,9 @@ const { token } = require('../config.json'); -const Discord = require('discord.js'); module.exports = { name: 'restart', description: '(Owner Only) Shuts down the bot.', - async execute(client, message, args) { + async execute(client, message) { if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { await message.channel.send(" Restarting...") try { diff --git a/commands/setnick.js b/commands/setnick.js index dac383e..43238ba 100644 --- a/commands/setnick.js +++ b/commands/setnick.js @@ -3,7 +3,7 @@ const { MessageEmbed } = require("discord.js"); module.exports = { name: 'setnick', description: 'Sets your nickname', - async execute(_, message, args, footerTxt) { + async execute(_, message, args, footer) { if (message.channel.permissionsFor(message.author).has("CHANGE_NICKNAME")) { const newnick = args.slice(0).join(" ") @@ -13,10 +13,7 @@ module.exports = { await message.channel.send(new MessageEmbed({ "title": "<:AnitroxSuccess:809651936819019796> Nickname Changed", "color": 9442302, - "footer": { - "icon_url": "https://images-ext-2.discordapp.net/external/-qaO3jaZLojhEnjrHiKABdXD7gLWqFvdUqHdskNGWhE/https/media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": footerTxt - }, + "footer": footer, "fields": [ { "name": "Changed nickname successfully!", @@ -33,10 +30,7 @@ module.exports = { await message.channel.send(new MessageEmbed({ "title": "<:AnitroxDenied:809651936642203668> Well that happened...", "color": 13632027, - "footer": { - "icon_url": "https://cdn.discordapp.com/embed/avatars/0.png", - "text": footerTxt - }, + "footer": footer, "fields": [ { "name": "Failed to set nickname", diff --git a/commands/slap.js b/commands/slap.js index 44aee4d..75ad264 100644 --- a/commands/slap.js +++ b/commands/slap.js @@ -4,17 +4,14 @@ module.exports = { name: "slap", description: "Slaps an user!", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { await message.channel.send(new MessageEmbed({ "title": "<:AnitroxError:809651936563429416> Error", "color": 13632027, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "fields": [ { "name": "Well that happened...", @@ -27,10 +24,7 @@ module.exports = { "title": ":anger: Slap", "description": "<@" + taggedUser + "> You have been slapped by <@" + messageAuthor + ">!", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "image": { "url": "https://media1.tenor.com/images/b6d8a83eb652a30b95e87cf96a21e007/tenor.gif?itemid=10426943" } diff --git a/commands/snuggle.js b/commands/snuggle.js index ab58a1f..02d894f 100644 --- a/commands/snuggle.js +++ b/commands/snuggle.js @@ -11,17 +11,14 @@ module.exports = { name: "snuggle", description: "Snuggle an user!", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { await message.channel.send(new MessageEmbed({ "title": "<:AnitroxError:809651936563429416> Error", "color": 13632027, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "fields": [ { "name": "Well that happened...", @@ -34,10 +31,7 @@ module.exports = { "title": "<:BlobSnuggleCat:806759753450782731> Snuggle", "description": "<@" + taggedUser + ">" + " You have been snuggled by " + "<@" + messageAuthor + ">!", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "image": { "url": gif } diff --git a/commands/stop.js b/commands/stop.js index 5251e0a..467b45a 100644 --- a/commands/stop.js +++ b/commands/stop.js @@ -3,16 +3,13 @@ const { MessageEmbed } = require("discord.js"); module.exports = { name: "stop", description: "Stops the bot", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, footer) { if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { await message.channel.send(new MessageEmbed({ "title": " **Shutting Down...**", "description": "See you next time!", "color": 9442302, - "footer": { - "icon_url": "https://media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": footerTxt - } + "footer": footer })); client.destroy(); } else { @@ -20,10 +17,7 @@ module.exports = { "title": ":AnitroxDenied: Access Denied", "description": "You need to be the bot owner to execute this command!", "color": 13632027, - "footer": { - "icon_url": "https://media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": footerTxt - } + "footer": footer })); } } diff --git a/commands/uinfo.js b/commands/uinfo.js index b1cb7dc..02ff83b 100644 --- a/commands/uinfo.js +++ b/commands/uinfo.js @@ -4,16 +4,13 @@ module.exports = { name: "uinfo", description: "Gets info about an user, such as ID, Discord Join date and more", syntax: "", - async execute(client, message, args, footerTxt) { + async execute(client, message, args, footer) { console.log(args[0]) const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author await message.channel.send(new MessageEmbed({ "title": "Everything you've ever wanted to know about " + user.username + "!", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "thumbnail": { "url": user.displayAvatarURL() }, diff --git a/start.js b/start.js index 11694bf..9ae17ca 100755 --- a/start.js +++ b/start.js @@ -4,6 +4,11 @@ const fs = require('fs'); const Discord = require('discord.js'); const { statuses, build, release, prefix, token, footerTxt } = require('./config.json'); +const embedFooter = { + "icon_url": "https://cdn.discordapp.com/attachments/549707869138714635/793524910172667964/Screenshot_26.png", + "text": footerTxt +} + console.log('Starting!') const client = new Discord.Client(); client.commands = new Discord.Collection(); @@ -17,7 +22,6 @@ for (const file of commandFiles) { client.on("error", (e) => console.log("[ERROR]" + error(e))); client.on("warn", (e) => ("[WARN]" + warn(e))); -// Log errors to console. client.once('ready', () => { console.clear() console.log(' ___ _ __ '); @@ -47,17 +51,14 @@ client.on('message', async (message) => { if (!client.commands.has(command)) return; try { - await client.commands.get(command).execute(client, message, args, footerTxt); + await client.commands.get(command).execute(client, message, args, embedFooter); } catch (error) { console.stack; message.channel.send(new Discord.MessageEmbed({ "title": "<:AnitroxError:809651936563429416> **Something went wrong!**", "description": error.stack, "color": 13632027, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + " | Something went wrong! :(" - } + "footer": footer })); } }); From 3651553256e199689eee7d261c91c17687e9c8ed Mon Sep 17 00:00:00 2001 From: Nathaniel Mason Date: Sat, 26 Mar 2022 16:02:17 +0000 Subject: [PATCH 04/22] change class constructors to json objects --- commands/8ball.js | 10 ++++------ commands/avatar.js | 6 ++---- commands/bonk.js | 10 ++++------ commands/cheese.js | 6 ++---- commands/cuddle.js | 6 ++---- commands/eval.js | 5 ++--- commands/help.js | 6 ++---- commands/hug.js | 10 ++++------ commands/info.js | 5 ++--- commands/invite.js | 6 ++---- commands/kiss.js | 10 ++++------ commands/leskiss.js | 10 ++++------ commands/lick.js | 10 ++++------ commands/nom.js | 10 ++++------ commands/opensource.js | 6 ++---- commands/pat.js | 10 ++++------ commands/ping.js | 5 ++--- commands/poke.js | 10 ++++------ commands/reload.js | 6 ++---- commands/setnick.js | 10 ++++------ commands/slap.js | 10 ++++------ commands/snuggle.js | 10 ++++------ commands/stop.js | 10 ++++------ commands/uinfo.js | 6 ++---- start.js | 4 ++-- 25 files changed, 76 insertions(+), 121 deletions(-) diff --git a/commands/8ball.js b/commands/8ball.js index b06b971..393aba5 100644 --- a/commands/8ball.js +++ b/commands/8ball.js @@ -1,5 +1,3 @@ -const { MessageEmbed } = require('discord.js'); - const answers = [ "Heck no!", "Are you crazy!? No!", @@ -31,14 +29,14 @@ module.exports = { console.log(args); if (!question) { - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": "<:AnitroxError:809651936563429416> **Something went wrong!**", "description": "You need to ask a question!", "color": 13632027, "footer": footer - })); + }}); } else { - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": ":8ball: Anitrox 8 Ball", "description": "Your question: **" + question + "**", "color": 9442302, @@ -49,7 +47,7 @@ module.exports = { "value": answer } ] - })); + }}); } } } \ No newline at end of file diff --git a/commands/avatar.js b/commands/avatar.js index 7d4ab07..7d4b3ea 100644 --- a/commands/avatar.js +++ b/commands/avatar.js @@ -1,5 +1,3 @@ -const { MessageEmbed } = require('discord.js'); - module.exports = { name: "avatar", @@ -8,13 +6,13 @@ module.exports = { const user = message.mentions.users.first() || message.author; - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": ":frame_photo: " + user.username + "'s Beautiful Avatar!", "color": 9442302, "footer": footer, "image": { "url": user.displayAvatarURL() } - })); + }}); } } diff --git a/commands/bonk.js b/commands/bonk.js index cd7b524..c4236cf 100644 --- a/commands/bonk.js +++ b/commands/bonk.js @@ -1,5 +1,3 @@ -const { MessageEmbed } = require("discord.js"); - module.exports = { name: "bonk", @@ -8,7 +6,7 @@ module.exports = { const taggedUser = message.mentions.users.first(); if(!taggedUser) { - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": "<:AnitroxError:809651936563429416> Error", "color": 13632027, "footer": { @@ -21,9 +19,9 @@ module.exports = { "value": "You need to @mention an user!" } ] - })); + }}); } else { - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": " Bonk", "description": "<@" + taggedUser + ">" + " You have been bonked by <@" + message.author + ">!", "color": 9442302, @@ -31,7 +29,7 @@ module.exports = { "image": { "url": "https://cdn.discordapp.com/attachments/793537380330111028/801194481549312060/HappyBONK.gif" } - })); + }}); } } } diff --git a/commands/cheese.js b/commands/cheese.js index f6cd89e..9a0ea45 100644 --- a/commands/cheese.js +++ b/commands/cheese.js @@ -1,5 +1,3 @@ -const { MessageEmbed } = require("discord.js"); - module.exports = { name: "cheese", description: "Cheese an user, or run just ``n!cheese`` for a surprise :eyes:", @@ -8,7 +6,7 @@ module.exports = { if(!taggedUser) { await message.channel.send("*slams cheese on desk* Cheese. https://www.youtube.com/watch?v=Or4IE8fkpn4"); } else { - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": ":cheese: Cheesed", "description": "<@" + taggedUser + ">" + " You got cheesed by " + "<@" + message.author + ">!", "color": 16312092, @@ -16,7 +14,7 @@ module.exports = { "image": { "url": "https://cdn.discordapp.com/attachments/803658122299572255/812867714368536636/R06325af354168febcafd96b8328b7590.png" } - })); + }}); } } } diff --git a/commands/cuddle.js b/commands/cuddle.js index 0eec8d3..f102261 100644 --- a/commands/cuddle.js +++ b/commands/cuddle.js @@ -1,5 +1,3 @@ -const { MessageEmbed } = 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", @@ -20,7 +18,7 @@ module.exports = { if(!taggedUser) { await message.channel.send("<:AnitroxError:809651936563429416> You need to specify an user!"); } else { - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": ":heart: Cuddle", "description": "<@" + taggedUser + ">" + " You have been cuddled by " + "<@" + message.author + ">!", "color": 9442302, @@ -28,7 +26,7 @@ module.exports = { "image": { "url": gif } - })); + }}); } } } diff --git a/commands/eval.js b/commands/eval.js index 543e340..529a432 100644 --- a/commands/eval.js +++ b/commands/eval.js @@ -1,4 +1,3 @@ -const { MessageEmbed } = require("discord.js"); const { inspect } = require("util"); module.exports = { @@ -12,7 +11,7 @@ module.exports = { const evaled = inspect(eval(code)); await message.channel.send(evaled, {code:"xl"}); } catch (error) { - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": "<:NyabotError:697145462347661412> **Well that happened...**", "color": 13632027, "footer": footer, @@ -26,7 +25,7 @@ module.exports = { "value": error.message } ] - })); + }}); } }; } diff --git a/commands/help.js b/commands/help.js index 465e857..ccd12c6 100644 --- a/commands/help.js +++ b/commands/help.js @@ -1,5 +1,3 @@ -const { MessageEmbed } = require("discord.js"); - module.exports = { name: 'help', @@ -7,7 +5,7 @@ module.exports = { syntax: '', async execute(_0, message, _1, footer) { - await message.channel.send(new MessageEmbed({ + 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, @@ -22,6 +20,6 @@ module.exports = { "value": "Join the [support server!](https://discord.gg/grebRGsBZ3)" } ] - })); + }}); } } diff --git a/commands/hug.js b/commands/hug.js index 5934d0f..402ced8 100644 --- a/commands/hug.js +++ b/commands/hug.js @@ -1,5 +1,3 @@ -const { MessageEmbed } = require("discord.js"); - const gifchoices = [ "https://cdn.discordapp.com/attachments/803658122299572255/807670647920001044/hug2.gif", "https://cdn.discordapp.com/attachments/803658122299572255/807670797983285268/hug1.gif", @@ -16,7 +14,7 @@ module.exports = { const taggedUser = message.mentions.users.first(); if(!taggedUser) { - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": "<:AnitroxError:809651936563429416> Error", "color": 9442302, "footer": { @@ -29,10 +27,10 @@ module.exports = { "value": "You need to @mention an user!" } ] - })); + }}); } else { const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": " Hug", "description": "<@" + taggedUser + ">" + " You have been hugged by " + "<@" + message.author + ">!", "color": 8311585, @@ -40,7 +38,7 @@ module.exports = { "image": { "url": gif } - })); + }}); } } } diff --git a/commands/info.js b/commands/info.js index 3a249bb..6a39d70 100644 --- a/commands/info.js +++ b/commands/info.js @@ -1,4 +1,3 @@ -const { MessageEmbed } = require('discord.js'); const {build, release} = require('../config.json'); module.exports = { @@ -26,7 +25,7 @@ module.exports = { const os = require("os"); const osu = require('node-os-utils'); const cpu = osu.cpu; - await message.channel.send(new MessageEmbed({ + 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, @@ -101,6 +100,6 @@ module.exports = { } ] - })); + }}); } }; diff --git a/commands/invite.js b/commands/invite.js index 72aabdd..78b4acf 100644 --- a/commands/invite.js +++ b/commands/invite.js @@ -1,12 +1,10 @@ -const { MessageEmbed } = require("discord.js"); - module.exports = { name: 'invite', description: 'Add Anitrox to your beautiful server!', syntax: [], async execute(_0, message, _1, footer) { - await message.channel.send(new MessageEmbed({ + 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, @@ -28,6 +26,6 @@ module.exports = { "value": "Come join the Anitrox Support Server, for support and much more!\n [Anitrox Support Server](https://discord.gg/grebRGsBZ3)" } ] - })); + }}); }, }; \ No newline at end of file diff --git a/commands/kiss.js b/commands/kiss.js index 7f8b6e0..fe5efd8 100644 --- a/commands/kiss.js +++ b/commands/kiss.js @@ -1,5 +1,3 @@ -const { MessageEmbed } = require("discord.js"); - const gifchoices = [ "https://cdn.discordapp.com/attachments/803658122299572255/807671954055626812/kiss5.gif", "https://cdn.discordapp.com/attachments/803658122299572255/807671956236140554/kiss2.gif", @@ -16,7 +14,7 @@ module.exports = { const taggedUser = message.mentions.users.first(); if(!taggedUser) { - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": "<:AnitroxError:809651936563429416> Error", "color": 13632027, "footer": footer, @@ -26,10 +24,10 @@ module.exports = { "value": "You need to @mention an user!" } ] - })); + }}); } else { const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": ":heart: Kiss", "description": "<@" + taggedUser + ">" + ", You have been kissed by <@" + message.author + ">!", "color": 9442302, @@ -37,7 +35,7 @@ module.exports = { "image": { "url": gif } - })); + }}); } } } diff --git a/commands/leskiss.js b/commands/leskiss.js index b257ce0..c16f007 100644 --- a/commands/leskiss.js +++ b/commands/leskiss.js @@ -1,5 +1,3 @@ -const { MessageEmbed } = require("discord.js"); - const gifchoices = [ "https://cdn.discordapp.com/attachments/793537380330111028/803833954750038066/gif5.gif", "https://cdn.discordapp.com/attachments/793537380330111028/803833959338475550/gif12.gif", @@ -26,7 +24,7 @@ module.exports = { const taggedUser = message.mentions.users.first(); if(!taggedUser) { - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": "<:AnitroxError:809651936563429416> Error", "color": 9442302, "footer": footer, @@ -36,10 +34,10 @@ module.exports = { "value": "You need to @mention an user!" } ] - })); + }}); } else { const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": ":heart: <:lesbian:803831629428686849> Kiss", "description": "<@" + taggedUser + ">" + " You have been kissed by <@" + message.author + ">! <:lesbian:803831629428686849>", "color": 8311585, @@ -47,7 +45,7 @@ module.exports = { "image": { "url": gif } - })); + }}); } } } diff --git a/commands/lick.js b/commands/lick.js index 907ce3b..21b4c5d 100644 --- a/commands/lick.js +++ b/commands/lick.js @@ -1,5 +1,3 @@ -const { MessageEmbed, Message } = require("discord.js"); - const gifchoices = [ "https://cdn.discordapp.com/attachments/803658122299572255/805314244123951114/cef569820773b0f5d54ee34cfa18e1f8.gif", "https://cdn.lowgif.com/full/2027501b8fa5225c-.gif", @@ -15,7 +13,7 @@ module.exports = { const taggedUser = message.mentions.users.first(); if(!taggedUser) { - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": "<:AnitroxError:809651936563429416> Error", "color": 9442302, "footer": footer, @@ -25,10 +23,10 @@ module.exports = { "value": "You need to @mention an user!" } ] - })); + }}); } else { const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": " Lick", "description": "<@" + taggedUser + "> You have been licked by <@" + message.author + ">!", "color": 8311585, @@ -36,7 +34,7 @@ module.exports = { "image": { "url": "https://cdn.discordapp.com/attachments/803658122299572255/805314244123951114/cef569820773b0f5d54ee34cfa18e1f8.gif" } - })); + }}); } } } diff --git a/commands/nom.js b/commands/nom.js index fe862dc..19857a7 100644 --- a/commands/nom.js +++ b/commands/nom.js @@ -1,5 +1,3 @@ -const { MessageEmbed } = require('discord.js'); - const gifchoices = [ "https://i.imgur.com/Ns1RBzX.gif", "https://cdn.lowgif.com/full/2027501b8fa5225c-.gif", @@ -15,7 +13,7 @@ module.exports = { const taggedUser = message.mentions.users.first(); if(!taggedUser) { - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": "<:AnitroxError:809651936563429416> Error", "color": 9442302, "footer": footer, @@ -25,10 +23,10 @@ module.exports = { "value": "You need to @mention an user!" } ] - })); + }}); } else { const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": "<:BlobNomBlob:801241117919805510> Nom", "description": "<@" + taggedUser + "> You have been nommed by <@" + messageAuthor + ">!", "color": 8311585, @@ -36,7 +34,7 @@ module.exports = { "image": { "url": gif } - })); + }}); } } } diff --git a/commands/opensource.js b/commands/opensource.js index 096128a..1c52f85 100644 --- a/commands/opensource.js +++ b/commands/opensource.js @@ -1,10 +1,8 @@ -const { MessageEmbed } = require("discord.js"); - module.exports = { name: 'opensource', description: 'Attributions to open source components used by Anitrox', async execute(_0, message, _1, footer){ - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": "Component Attribution", "description": "Some parts of Anitrox are using open source code, and their attributions are avaliable here!", "color": 52508, @@ -26,6 +24,6 @@ module.exports = { "value": "Using and supporting the Anitrox Project, thank you! ❤" } ] - })); + }}); } } \ No newline at end of file diff --git a/commands/pat.js b/commands/pat.js index cc1ab0b..d5024a3 100644 --- a/commands/pat.js +++ b/commands/pat.js @@ -1,5 +1,3 @@ -const { MessageEmbed } = 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", @@ -14,7 +12,7 @@ module.exports = { const taggedUser = message.mentions.users.first(); if(!taggedUser) { - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": "<:AnitroxError:809651936563429416> Error", "color": 9442302, "footer": footer, @@ -24,10 +22,10 @@ module.exports = { "value": "You need to @mention an user!" } ] - })); + }}); } else { const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": "<:pats:801238281286713355> Pat", "description": "<@" + taggedUser + "> You have been patted by <@" + messageAuthor + ">!", "color": 8311585, @@ -35,7 +33,7 @@ module.exports = { "image": { "url": gif } - })); + }}); } } } diff --git a/commands/ping.js b/commands/ping.js index 6e46014..57b20c5 100644 --- a/commands/ping.js +++ b/commands/ping.js @@ -1,4 +1,3 @@ -const { MessageEmbed } = require('discord.js'); const { locations } = require('../config.json'); module.exports = { @@ -8,11 +7,11 @@ module.exports = { const index = Math.floor(Math.random() * locations.length); const pingLocation = locations[index] - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed:{ "title": ":ping_pong: Ping", "description": "**Pong!** We pinged **" + pingLocation + "** and got " + client.ws.ping + " ms.", "color": 9442302, "footer": footer - })); + }}); } }; diff --git a/commands/poke.js b/commands/poke.js index ee133b7..f338634 100644 --- a/commands/poke.js +++ b/commands/poke.js @@ -1,5 +1,3 @@ -const { MessageEmbed } = require("discord.js"); - const gifchoices = [ "https://i.pinimg.com/originals/b4/95/fb/b495fb19f4b9a1b04f48297b676c497b.gif", "https://i.imgur.com/H7Ok5tn.gif", @@ -14,7 +12,7 @@ module.exports = { const taggedUser = message.mentions.users.first(); if(!taggedUser) { - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": "<:AnitroxError:809651936563429416> Error", "color": 9442302, "footer": footer, @@ -24,10 +22,10 @@ module.exports = { "value": "You need to @mention an user!" } ] - })); + }}); } else { const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": "👉 Poke!", "description": "<@" + taggedUser + "> You have been poked by <@" + message.author + ">!", "color": 8311585, @@ -35,7 +33,7 @@ module.exports = { "image": { "url": gif } - })); + }}); } } } diff --git a/commands/reload.js b/commands/reload.js index a9c9754..b8e1e09 100644 --- a/commands/reload.js +++ b/commands/reload.js @@ -1,5 +1,3 @@ -const { MessageEmbed } = require("discord.js"); - module.exports = { name: 'reload', description: 'Reloads a command', @@ -26,7 +24,7 @@ module.exports = { } } } else { - message.channel.send(new MessageEmbed({ + message.channel.send({embed: { "title": "<:NyabotDenied:697145462565896194> **Access is denied**", "color": 13632027, "footer": footer, @@ -36,7 +34,7 @@ module.exports = { "value": "You don't have the appropriate permissions to run this command!" } ] - })); + }}); } } }; \ No newline at end of file diff --git a/commands/setnick.js b/commands/setnick.js index 43238ba..1d1d204 100644 --- a/commands/setnick.js +++ b/commands/setnick.js @@ -1,5 +1,3 @@ -const { MessageEmbed } = require("discord.js"); - module.exports = { name: 'setnick', description: 'Sets your nickname', @@ -10,7 +8,7 @@ module.exports = { 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(new MessageEmbed({ + await message.channel.send({embed: { "title": "<:AnitroxSuccess:809651936819019796> Nickname Changed", "color": 9442302, "footer": footer, @@ -25,9 +23,9 @@ module.exports = { "inline": true } ] - })); + }}); } catch (error) { - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": "<:AnitroxDenied:809651936642203668> Well that happened...", "color": 13632027, "footer": footer, @@ -37,7 +35,7 @@ module.exports = { "value": "You need to have permission ``CHANGE_NICKNAME`` to change your nick!" } ] - })); + }}); }; }; } diff --git a/commands/slap.js b/commands/slap.js index 75ad264..9f57976 100644 --- a/commands/slap.js +++ b/commands/slap.js @@ -1,5 +1,3 @@ -const { MessageEmbed } = require("discord.js"); - module.exports = { name: "slap", @@ -8,7 +6,7 @@ module.exports = { const taggedUser = message.mentions.users.first(); if(!taggedUser) { - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": "<:AnitroxError:809651936563429416> Error", "color": 13632027, "footer": footer, @@ -18,9 +16,9 @@ module.exports = { "value": "You need to @mention an user!" } ] - })); + }}); } else { - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": ":anger: Slap", "description": "<@" + taggedUser + "> You have been slapped by <@" + messageAuthor + ">!", "color": 9442302, @@ -28,7 +26,7 @@ module.exports = { "image": { "url": "https://media1.tenor.com/images/b6d8a83eb652a30b95e87cf96a21e007/tenor.gif?itemid=10426943" } - })); + }}); } } } diff --git a/commands/snuggle.js b/commands/snuggle.js index 02d894f..f9f0e51 100644 --- a/commands/snuggle.js +++ b/commands/snuggle.js @@ -1,5 +1,3 @@ -const { MessageEmbed } = 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", @@ -15,7 +13,7 @@ module.exports = { const taggedUser = message.mentions.users.first(); if(!taggedUser) { - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": "<:AnitroxError:809651936563429416> Error", "color": 13632027, "footer": footer, @@ -25,9 +23,9 @@ module.exports = { "value": "You need to @mention an user!" } ] - })); + }}); } else { - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": "<:BlobSnuggleCat:806759753450782731> Snuggle", "description": "<@" + taggedUser + ">" + " You have been snuggled by " + "<@" + messageAuthor + ">!", "color": 9442302, @@ -35,7 +33,7 @@ module.exports = { "image": { "url": gif } - })); + }}); } } } \ No newline at end of file diff --git a/commands/stop.js b/commands/stop.js index 467b45a..72e5d4d 100644 --- a/commands/stop.js +++ b/commands/stop.js @@ -1,24 +1,22 @@ -const { MessageEmbed } = require("discord.js"); - module.exports = { name: "stop", description: "Stops the bot", async execute(client, message, _, footer) { if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": " **Shutting Down...**", "description": "See you next time!", "color": 9442302, "footer": footer - })); + }}); client.destroy(); } else { - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": ":AnitroxDenied: Access Denied", "description": "You need to be the bot owner to execute this command!", "color": 13632027, "footer": footer - })); + }}); } } } \ No newline at end of file diff --git a/commands/uinfo.js b/commands/uinfo.js index 02ff83b..31e735f 100644 --- a/commands/uinfo.js +++ b/commands/uinfo.js @@ -1,5 +1,3 @@ -const { MessageEmbed } = require("discord.js"); - module.exports = { name: "uinfo", description: "Gets info about an user, such as ID, Discord Join date and more", @@ -7,7 +5,7 @@ module.exports = { async execute(client, message, args, footer) { console.log(args[0]) const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author - await message.channel.send(new MessageEmbed({ + await message.channel.send({embed: { "title": "Everything you've ever wanted to know about " + user.username + "!", "color": 9442302, "footer": footer, @@ -49,6 +47,6 @@ module.exports = { inline: true }, ] - })); + }}); } } diff --git a/start.js b/start.js index 9ae17ca..4d2a77a 100755 --- a/start.js +++ b/start.js @@ -34,10 +34,10 @@ client.once('ready', () => { }); -setInterval(() => { +setInterval(async () => { // Picks a status from the config file const index = Math.floor(Math.random() * statuses.length); - client.user.setActivity(statuses[index]); + await client.user.setActivity(statuses[index]); }, 20000); // Begin Command Handler From 66ef27b8e62807e4755f3e171eed6ba216739d0b Mon Sep 17 00:00:00 2001 From: Nathaniel Mason Date: Sat, 26 Mar 2022 17:30:38 +0000 Subject: [PATCH 05/22] add config-example.json back --- config-example.json | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 config-example.json diff --git a/config-example.json b/config-example.json new file mode 100644 index 0000000..e8786e6 --- /dev/null +++ b/config-example.json @@ -0,0 +1,37 @@ +{ + "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", + "Minecraft", + "with the network connections.", + "VLC Media Player", + "Chromium" + ], + "locations": [ + "Microsoft", + "LinusTechTips", + "Linus Torvalds", + "borkeonv2", + "Google", + "192.168.1.1", + "127.0.0.1", + "Sophie's computer", + "Mars", + "Elon Musk", + "TMC Software" + ] + } \ No newline at end of file From 4d51f2b5a7936a4f2140c31f19abd5c69959b5e6 Mon Sep 17 00:00:00 2001 From: Nathaniel Mason Date: Sat, 26 Mar 2022 17:31:03 +0000 Subject: [PATCH 06/22] new error embed generator + some more patches --- commands/8ball.js | 15 +++++-------- commands/avatar.js | 9 +++++--- commands/bonk.js | 22 +++++-------------- commands/cheese.js | 9 +++++--- commands/cuddle.js | 9 +++++--- commands/eval.js | 7 ++++-- commands/help.js | 7 ++++-- commands/hug.js | 22 +++++-------------- commands/info.js | 7 ++++-- commands/invite.js | 7 ++++-- commands/kiss.js | 19 +++++----------- commands/leskiss.js | 19 +++++----------- commands/lick.js | 21 ++++++------------ commands/nom.js | 21 ++++++------------ commands/opensource.js | 7 ++++-- commands/pat.js | 21 ++++++------------ commands/ping.js | 7 ++++-- commands/poke.js | 21 ++++++------------ commands/reload.js | 50 ++++++++++++++++++++++++------------------ commands/setnick.js | 23 ++++++++----------- commands/slap.js | 21 ++++++------------ commands/snuggle.js | 22 +++++++------------ commands/stop.js | 12 +++++++--- commands/uinfo.js | 8 ++++--- start.js | 31 ++++++++++++++++++-------- 25 files changed, 195 insertions(+), 222 deletions(-) diff --git a/commands/8ball.js b/commands/8ball.js index 393aba5..13893ec 100644 --- a/commands/8ball.js +++ b/commands/8ball.js @@ -23,24 +23,21 @@ module.exports = { name: '8ball', description: 'Ask Anitrox a question, any question! and they will answer it!', syntax: ["[Question]"], - async execute(_, message, args, footer) { + async execute(client, message, args, footerTxt) { const answer = answers[Math.floor(Math.random() * Object.keys(answers).length)]; const question = args.slice(0).join(" ") - console.log(args); if (!question) { - await message.channel.send({embed: { - "title": "<:AnitroxError:809651936563429416> **Something went wrong!**", - "description": "You need to ask a question!", - "color": 13632027, - "footer": footer - }}); + await message.channel.send(client.generateErrorMessage("You need to ask a question!", message.author.displayAvatarURL)); } else { await message.channel.send({embed: { "title": ":8ball: Anitrox 8 Ball", "description": "Your question: **" + question + "**", "color": 9442302, - "footer": footer, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, "fields": [ { "name": "🤔 My Answer", diff --git a/commands/avatar.js b/commands/avatar.js index 7d4b3ea..a4a02ff 100644 --- a/commands/avatar.js +++ b/commands/avatar.js @@ -2,14 +2,17 @@ module.exports = { name: "avatar", description: "Gets a user's avatar.", - async execute(_0, message, _1, footer) { + async execute(client, message, args, footerTxt) { - const user = message.mentions.users.first() || message.author; + 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": footer, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, "image": { "url": user.displayAvatarURL() } diff --git a/commands/bonk.js b/commands/bonk.js index c4236cf..fa6ee22 100644 --- a/commands/bonk.js +++ b/commands/bonk.js @@ -2,30 +2,20 @@ module.exports = { name: "bonk", description: "Bonks a user!", - async execute(_0, message, _1, footer) { + async execute(client, message, _, footerTxt) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { - await message.channel.send({embed: { - "title": "<:AnitroxError:809651936563429416> Error", - "color": 13632027, - "footer": { - "icon_url": "https://images-ext-2.discordapp.net/external/-qaO3jaZLojhEnjrHiKABdXD7gLWqFvdUqHdskNGWhE/https/media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": "Made with ❤ in Illinois | Anitrox by IDeletedSystem64" - }, - "fields": [ - { - "name": "Well that happened...", - "value": "You need to @mention an user!" - } - ] - }}); + await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL())); } else { await message.channel.send({embed: { "title": " Bonk", "description": "<@" + taggedUser + ">" + " You have been bonked by <@" + message.author + ">!", "color": 9442302, - "footer": footer, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, "image": { "url": "https://cdn.discordapp.com/attachments/793537380330111028/801194481549312060/HappyBONK.gif" } diff --git a/commands/cheese.js b/commands/cheese.js index 9a0ea45..533eb41 100644 --- a/commands/cheese.js +++ b/commands/cheese.js @@ -1,16 +1,19 @@ module.exports = { name: "cheese", description: "Cheese an user, or run just ``n!cheese`` for a surprise :eyes:", - async execute(_0, message, _1, footer) { + async execute(_0, message, _1, footerTxt) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { - await message.channel.send("*slams cheese on desk* Cheese. https://www.youtube.com/watch?v=Or4IE8fkpn4"); + 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 got cheesed by " + "<@" + message.author + ">!", "color": 16312092, - "footer": footer, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, "image": { "url": "https://cdn.discordapp.com/attachments/803658122299572255/812867714368536636/R06325af354168febcafd96b8328b7590.png" } diff --git a/commands/cuddle.js b/commands/cuddle.js index f102261..d7d017a 100644 --- a/commands/cuddle.js +++ b/commands/cuddle.js @@ -9,20 +9,23 @@ module.exports = { name: "cuddle", description: "Cuddle an user!", - async execute(_0, message, _1, footer) { + async execute(client, message, _, footerTxt) { const taggedUser = message.mentions.users.first(); const index = Math.floor(Math.random() * gifchoices.length); const gif = (gifchoices[index]); if(!taggedUser) { - await message.channel.send("<:AnitroxError:809651936563429416> You need to specify an user!"); + await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL())); } else { await message.channel.send({embed: { "title": ":heart: Cuddle", "description": "<@" + taggedUser + ">" + " You have been cuddled by " + "<@" + message.author + ">!", "color": 9442302, - "footer": footer, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, "image": { "url": gif } diff --git a/commands/eval.js b/commands/eval.js index 529a432..b94dde9 100644 --- a/commands/eval.js +++ b/commands/eval.js @@ -4,7 +4,7 @@ module.exports = { name: 'eval', description: 'Runs js code', - async execute(_, message, args, footer) { + async execute(_, message, args, footerTxt) { if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { try { const code = args.join(" "); @@ -14,7 +14,10 @@ module.exports = { await message.channel.send({embed: { "title": "<:NyabotError:697145462347661412> **Well that happened...**", "color": 13632027, - "footer": footer, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, "fields": [ { "name": "**What Happened?**", diff --git a/commands/help.js b/commands/help.js index ccd12c6..6939ba5 100644 --- a/commands/help.js +++ b/commands/help.js @@ -4,12 +4,15 @@ module.exports = { description: 'Get help on anything from commands, to what the bot does! just not your homework..', syntax: '', - async execute(_0, message, _1, footer) { + async execute(_0, message, _1, footerTxt) { 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": footer, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + " | No mother it's just the northern lights" + }, "fields": [ { "name": "Command List", diff --git a/commands/hug.js b/commands/hug.js index 402ced8..3e1730f 100644 --- a/commands/hug.js +++ b/commands/hug.js @@ -10,31 +10,21 @@ module.exports = { name: "hug", description: "Hugs a user!", - async execute(_0, message, _1, footer) { + async execute(client, message, _, footerTxt) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { - await message.channel.send({embed: { - "title": "<:AnitroxError:809651936563429416> Error", - "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": message.author.displayAvatarURL() - }, - "fields": [ - { - "name": "Well that happened...", - "value": "You need to @mention an user!" - } - ] - }}); + await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL())); } 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": footer, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, "image": { "url": gif } diff --git a/commands/info.js b/commands/info.js index 6a39d70..0ef4fd2 100644 --- a/commands/info.js +++ b/commands/info.js @@ -4,7 +4,7 @@ module.exports = { name: 'info', description: 'Shows bot and host information', - async execute(client, message, _, footer) { + async execute(client, message, _, footerTxt) { function Uptime(uptime) { const totalSeconds = (uptime / 1000); @@ -29,7 +29,10 @@ module.exports = { "title": "<:AnitroxInfo:809651936831733791> Information about Anitrox", "description": "Everything you've ever wanted to know about your favorite bot, Anitrox!", "color": 9442302, - "footer": footer, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, "thumbnail": { "url": client.user.displayAvatarURL() }, diff --git a/commands/invite.js b/commands/invite.js index 78b4acf..ce04d12 100644 --- a/commands/invite.js +++ b/commands/invite.js @@ -3,12 +3,15 @@ module.exports = { name: 'invite', description: 'Add Anitrox to your beautiful server!', syntax: [], - async execute(_0, message, _1, footer) { + async execute(_0, message, _1, footerTxt) { 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": footer, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, "thumbnail": { "url": "https://cdn.discordapp.com/attachments/803658122299572255/814352905394061322/anitroxaddsrvr.png" }, diff --git a/commands/kiss.js b/commands/kiss.js index fe5efd8..f8cd102 100644 --- a/commands/kiss.js +++ b/commands/kiss.js @@ -10,28 +10,21 @@ module.exports = { name: "kiss", description: "Kisses a user!", - async execute(_0, message, _1, footer) { + async execute(client, message, _, footerTxt) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { - await message.channel.send({embed: { - "title": "<:AnitroxError:809651936563429416> Error", - "color": 13632027, - "footer": footer, - "fields": [ - { - "name": "Well that happened...", - "value": "You need to @mention an user!" - } - ] - }}); + await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL())); } 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": footer, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, "image": { "url": gif } diff --git a/commands/leskiss.js b/commands/leskiss.js index c16f007..45192f7 100644 --- a/commands/leskiss.js +++ b/commands/leskiss.js @@ -20,28 +20,21 @@ module.exports = { name: "leskiss", description: "Lesbian kiss <:lesbian:803831629428686849>", - async execute(_0, message, _1, footer) { + async execute(client, message, _, footerTxt) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { - await message.channel.send({embed: { - "title": "<:AnitroxError:809651936563429416> Error", - "color": 9442302, - "footer": footer, - "fields": [ - { - "name": "Well that happened...", - "value": "You need to @mention an user!" - } - ] - }}); + await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL())); } 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 + ">! <:lesbian:803831629428686849>", "color": 8311585, - "footer": footer, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, "image": { "url": gif } diff --git a/commands/lick.js b/commands/lick.js index 21b4c5d..b7a4748 100644 --- a/commands/lick.js +++ b/commands/lick.js @@ -8,29 +8,22 @@ const gifchoices = [ module.exports = { name: "lick", - description: "Licks an user!", - async execute(_0, message, _1, footer) { + description: "Licks a user!", + async execute(client, message, _, footerTxt) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { - await message.channel.send({embed: { - "title": "<:AnitroxError:809651936563429416> Error", - "color": 9442302, - "footer": footer, - "fields": [ - { - "name": "Well that happened...", - "value": "You need to @mention an user!" - } - ] - }}); + await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL())); } 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": footer, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, "image": { "url": "https://cdn.discordapp.com/attachments/803658122299572255/805314244123951114/cef569820773b0f5d54ee34cfa18e1f8.gif" } diff --git a/commands/nom.js b/commands/nom.js index 19857a7..ebb5ce4 100644 --- a/commands/nom.js +++ b/commands/nom.js @@ -9,28 +9,21 @@ module.exports = { name: "nom", description: "Noms an user!", - async execute(_0, message, _1, footer) { + async execute(client, message, _, footerTxt) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { - await message.channel.send({embed: { - "title": "<:AnitroxError:809651936563429416> Error", - "color": 9442302, - "footer": footer, - "fields": [ - { - "name": "Well that happened...", - "value": "You need to @mention an user!" - } - ] - }}); + await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL())); } 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 <@" + messageAuthor + ">!", + "description": "<@" + taggedUser + "> You have been nommed by <@" + message.author + ">!", "color": 8311585, - "footer": footer, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, "image": { "url": gif } diff --git a/commands/opensource.js b/commands/opensource.js index 1c52f85..8b14c43 100644 --- a/commands/opensource.js +++ b/commands/opensource.js @@ -1,12 +1,15 @@ module.exports = { name: 'opensource', description: 'Attributions to open source components used by Anitrox', - async execute(_0, message, _1, footer){ + async execute(_0, message, _1, footerTxt){ await message.channel.send({embed: { "title": "Component Attribution", "description": "Some parts of Anitrox are using open source code, and their attributions are avaliable here!", "color": 52508, - "footer": footer, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, "thumbnail": { "url": "https://cdn.discordapp.com/attachments/803658122299572255/838854256471703602/793885335498522685.png" }, diff --git a/commands/pat.js b/commands/pat.js index d5024a3..af031b5 100644 --- a/commands/pat.js +++ b/commands/pat.js @@ -8,28 +8,21 @@ module.exports = { name: "pat", description: "Pats a user!", - async execute(_0, message, _1, footer) { + async execute(client, message, _, footerTxt) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { - await message.channel.send({embed: { - "title": "<:AnitroxError:809651936563429416> Error", - "color": 9442302, - "footer": footer, - "fields": [ - { - "name": "Well that happened...", - "value": "You need to @mention an user!" - } - ] - }}); + await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL())); } 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 <@" + messageAuthor + ">!", + "description": "<@" + taggedUser + "> You have been patted by <@" + message.author + ">!", "color": 8311585, - "footer": footer, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, "image": { "url": gif } diff --git a/commands/ping.js b/commands/ping.js index 57b20c5..ef253d2 100644 --- a/commands/ping.js +++ b/commands/ping.js @@ -3,7 +3,7 @@ const { locations } = require('../config.json'); module.exports = { name: "ping", description: "Gets bot ping", - async execute(client, message, _, footer) { + async execute(client, message, _, footerTxt) { const index = Math.floor(Math.random() * locations.length); const pingLocation = locations[index] @@ -11,7 +11,10 @@ module.exports = { "title": ":ping_pong: Ping", "description": "**Pong!** We pinged **" + pingLocation + "** and got " + client.ws.ping + " ms.", "color": 9442302, - "footer": footer + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + } }}); } }; diff --git a/commands/poke.js b/commands/poke.js index f338634..9334db8 100644 --- a/commands/poke.js +++ b/commands/poke.js @@ -7,29 +7,22 @@ const gifchoices = [ module.exports = { name: "poke", - description: "Pokes an user!", - async execute(_0, message, _1, footer) { + description: "Pokes a user!", + async execute(client, message, _, footerTxt) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { - await message.channel.send({embed: { - "title": "<:AnitroxError:809651936563429416> Error", - "color": 9442302, - "footer": footer, - "fields": [ - { - "name": "Well that happened...", - "value": "You need to @mention an user!" - } - ] - }}); + await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL())); } 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": footer, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, "image": { "url": gif } diff --git a/commands/reload.js b/commands/reload.js index b8e1e09..b04dbba 100644 --- a/commands/reload.js +++ b/commands/reload.js @@ -1,33 +1,41 @@ module.exports = { name: 'reload', description: 'Reloads a command', - args: true, - async execute(client, message, args, footer) { + async execute(client, message, args, footerTxt) { if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { - const commandName = args[0].toLowerCase(); - const command = message.client.commands.get(commandName) - || message.client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName)); - - if (!command) { - await message.channel.send(`There is no command with name or alias \`${commandName}\`, ${message.author}!`); - } 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(`<:NyabotSuccess:697211376740859914> **Reloaded \`${command.name}\` successfully!**`); - console.log(`User reloaded ${command.name}.`) - } catch (error) { - console.error(error); - await message.channel.send(`<:AnitroxError:809651936563429416> There was an error while reloading \`${command.name}\`:\n\`${error.message}\``); - } + 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)); + + if (!command) { + await message.channel.send(client.generateErrorMessage(`There is no command with name or alias \`${commandName}\`, ${message.author}!`,message.author.displayAvatarURL())); + } 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(`<:NyabotSuccess:697211376740859914> **Reloaded \`${command.name}\` successfully!**`); + 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())); + } + } + }); + } else { message.channel.send({embed: { "title": "<:NyabotDenied:697145462565896194> **Access is denied**", "color": 13632027, - "footer": footer, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, "fields": [ { "name": "**What Happened?**", diff --git a/commands/setnick.js b/commands/setnick.js index 1d1d204..efa1e1c 100644 --- a/commands/setnick.js +++ b/commands/setnick.js @@ -1,7 +1,7 @@ module.exports = { name: 'setnick', description: 'Sets your nickname', - async execute(_, message, args, footer) { + async execute(client, message, args, footerTxt) { if (message.channel.permissionsFor(message.author).has("CHANGE_NICKNAME")) { const newnick = args.slice(0).join(" ") @@ -11,7 +11,10 @@ module.exports = { await message.channel.send({embed: { "title": "<:AnitroxSuccess:809651936819019796> Nickname Changed", "color": 9442302, - "footer": footer, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, "fields": [ { "name": "Changed nickname successfully!", @@ -25,18 +28,10 @@ module.exports = { ] }}); } catch (error) { - await message.channel.send({embed: { - "title": "<:AnitroxDenied:809651936642203668> Well that happened...", - "color": 13632027, - "footer": footer, - "fields": [ - { - "name": "Failed to set nickname", - "value": "You need to have permission ``CHANGE_NICKNAME`` to change your nick!" - } - ] - }}); + 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())); + } } } diff --git a/commands/slap.js b/commands/slap.js index 9f57976..0f1564b 100644 --- a/commands/slap.js +++ b/commands/slap.js @@ -2,27 +2,20 @@ module.exports = { name: "slap", description: "Slaps an user!", - async execute(_0, message, _1, footer) { + async execute(client, message, _, footerTxt) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { - await message.channel.send({embed: { - "title": "<:AnitroxError:809651936563429416> Error", - "color": 13632027, - "footer": footer, - "fields": [ - { - "name": "Well that happened...", - "value": "You need to @mention an user!" - } - ] - }}); + await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL())); } else { await message.channel.send({embed: { "title": ":anger: Slap", - "description": "<@" + taggedUser + "> You have been slapped by <@" + messageAuthor + ">!", + "description": "<@" + taggedUser + "> You have been slapped by <@" + message.author + ">!", "color": 9442302, - "footer": footer, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, "image": { "url": "https://media1.tenor.com/images/b6d8a83eb652a30b95e87cf96a21e007/tenor.gif?itemid=10426943" } diff --git a/commands/snuggle.js b/commands/snuggle.js index f9f0e51..b90a0cb 100644 --- a/commands/snuggle.js +++ b/commands/snuggle.js @@ -9,27 +9,21 @@ module.exports = { name: "snuggle", description: "Snuggle an user!", - async execute(_0, message, _1, footer) { + async execute(client, message, _, footerTxt) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { - await message.channel.send({embed: { - "title": "<:AnitroxError:809651936563429416> Error", - "color": 13632027, - "footer": footer, - "fields": [ - { - "name": "Well that happened...", - "value": "You need to @mention an user!" - } - ] - }}); + await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL())); } 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 " + "<@" + messageAuthor + ">!", + "description": "<@" + taggedUser + ">" + " You have been snuggled by " + "<@" + message.author + ">!", "color": 9442302, - "footer": footer, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, "image": { "url": gif } diff --git a/commands/stop.js b/commands/stop.js index 72e5d4d..a106573 100644 --- a/commands/stop.js +++ b/commands/stop.js @@ -1,13 +1,16 @@ module.exports = { name: "stop", description: "Stops the bot", - async execute(client, message, _, footer) { + async execute(client, message, _, footerTxt) { if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { await message.channel.send({embed: { "title": " **Shutting Down...**", "description": "See you next time!", "color": 9442302, - "footer": footer + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, }}); client.destroy(); } else { @@ -15,7 +18,10 @@ module.exports = { "title": ":AnitroxDenied: Access Denied", "description": "You need to be the bot owner to execute this command!", "color": 13632027, - "footer": footer + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, }}); } } diff --git a/commands/uinfo.js b/commands/uinfo.js index 31e735f..138c8a7 100644 --- a/commands/uinfo.js +++ b/commands/uinfo.js @@ -2,13 +2,15 @@ module.exports = { name: "uinfo", description: "Gets info about an user, such as ID, Discord Join date and more", syntax: "", - async execute(client, message, args, footer) { - console.log(args[0]) + async execute(client, message, args, footerTxt) { 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": footer, + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, "thumbnail": { "url": user.displayAvatarURL() }, diff --git a/start.js b/start.js index 4d2a77a..e823731 100755 --- a/start.js +++ b/start.js @@ -4,11 +4,6 @@ const fs = require('fs'); const Discord = require('discord.js'); const { statuses, build, release, prefix, token, footerTxt } = require('./config.json'); -const embedFooter = { - "icon_url": "https://cdn.discordapp.com/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": footerTxt -} - console.log('Starting!') const client = new Discord.Client(); client.commands = new Discord.Collection(); @@ -20,6 +15,21 @@ for (const file of commandFiles) { client.commands.set(command.name, command); } +client.generateErrorMessage = (errorMsg, messageAuthorURL) => ({embed: { + "title": "<:AnitroxError:809651936563429416> Error", + "color": 13632027, + "footer": { + "icon_url": messageAuthorURL, + "text": footerTxt + }, + "fields": [ + { + "name": "Well that happened...", + "value": errorMsg + } + ] +}}) + client.on("error", (e) => console.log("[ERROR]" + error(e))); client.on("warn", (e) => ("[WARN]" + warn(e))); client.once('ready', () => { @@ -51,15 +61,18 @@ client.on('message', async (message) => { if (!client.commands.has(command)) return; try { - await client.commands.get(command).execute(client, message, args, embedFooter); + await client.commands.get(command).execute(client, message, args, footerTxt); } catch (error) { console.stack; - message.channel.send(new Discord.MessageEmbed({ + message.channel.send({embed: { "title": "<:AnitroxError:809651936563429416> **Something went wrong!**", "description": error.stack, "color": 13632027, - "footer": footer - })); + "footer": { + "icon_url": message.author.displayAvatarURL(), + "text": footerTxt + }, + }}); } }); From 7bfbe0a02175456d2bfc52c5aed7edeadc108d67 Mon Sep 17 00:00:00 2001 From: Nathaniel Mason Date: Sat, 26 Mar 2022 18:20:32 +0000 Subject: [PATCH 07/22] string formatting with templates --- commands/8ball.js | 2 +- commands/avatar.js | 2 +- commands/bonk.js | 2 +- commands/cheese.js | 2 +- commands/cuddle.js | 2 +- commands/help.js | 2 +- commands/hug.js | 2 +- commands/info.js | 10 +++++----- commands/kiss.js | 2 +- commands/leskiss.js | 2 +- commands/lick.js | 2 +- commands/nom.js | 2 +- commands/pat.js | 2 +- commands/ping.js | 2 +- commands/poke.js | 2 +- commands/slap.js | 2 +- commands/snuggle.js | 2 +- commands/uinfo.js | 4 ++-- start.js | 10 +++++----- 19 files changed, 28 insertions(+), 28 deletions(-) diff --git a/commands/8ball.js b/commands/8ball.js index 13893ec..c514b2e 100644 --- a/commands/8ball.js +++ b/commands/8ball.js @@ -32,7 +32,7 @@ module.exports = { } else { await message.channel.send({embed: { "title": ":8ball: Anitrox 8 Ball", - "description": "Your question: **" + question + "**", + "description": `Your question: **${question}**`, "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), diff --git a/commands/avatar.js b/commands/avatar.js index a4a02ff..5db6668 100644 --- a/commands/avatar.js +++ b/commands/avatar.js @@ -7,7 +7,7 @@ module.exports = { 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!", + "title": `:frame_photo: ${user.username}'s Beautiful Avatar!`, "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), diff --git a/commands/bonk.js b/commands/bonk.js index fa6ee22..ab0a7c4 100644 --- a/commands/bonk.js +++ b/commands/bonk.js @@ -10,7 +10,7 @@ module.exports = { } else { await message.channel.send({embed: { "title": " Bonk", - "description": "<@" + taggedUser + ">" + " You have been bonked by <@" + message.author + ">!", + "description": `${taggedUser} You have been bonked by ${message.author}!`, "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), diff --git a/commands/cheese.js b/commands/cheese.js index 533eb41..ff3da46 100644 --- a/commands/cheese.js +++ b/commands/cheese.js @@ -8,7 +8,7 @@ module.exports = { } else { await message.channel.send({embed: { "title": ":cheese: Cheesed", - "description": "<@" + taggedUser + ">" + " You got cheesed by " + "<@" + message.author + ">!", + "description": `${taggedUser} You have been cheesed by ${message.author}!`, "color": 16312092, "footer": { "icon_url": message.author.displayAvatarURL(), diff --git a/commands/cuddle.js b/commands/cuddle.js index d7d017a..35f0183 100644 --- a/commands/cuddle.js +++ b/commands/cuddle.js @@ -20,7 +20,7 @@ module.exports = { } else { await message.channel.send({embed: { "title": ":heart: Cuddle", - "description": "<@" + taggedUser + ">" + " You have been cuddled by " + "<@" + message.author + ">!", + "description": `${taggedUser} You have been cuddled by ${message.author}!`, "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), diff --git a/commands/help.js b/commands/help.js index 6939ba5..1a622fa 100644 --- a/commands/help.js +++ b/commands/help.js @@ -11,7 +11,7 @@ module.exports = { "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + " | No mother it's just the northern lights" + "text": `${footerTxt} | No mother it's just the northern lights` }, "fields": [ { diff --git a/commands/hug.js b/commands/hug.js index 3e1730f..1d95374 100644 --- a/commands/hug.js +++ b/commands/hug.js @@ -19,7 +19,7 @@ module.exports = { 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 + ">!", + "description": `${taggedUser} You have been hugged by ${message.author}!`, "color": 8311585, "footer": { "icon_url": message.author.displayAvatarURL(), diff --git a/commands/info.js b/commands/info.js index 0ef4fd2..a58b9d5 100644 --- a/commands/info.js +++ b/commands/info.js @@ -58,7 +58,7 @@ module.exports = { }, { "name": "<:memory:793536677737136178> Bot Memory Usage", - "value": (Math.round(process.memoryUsage().heapUsed / 1024 / 1024 * 100) / 100) + " MiB", + "value": `${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MiB`, "inline": true }, { @@ -68,7 +68,7 @@ module.exports = { }, { "name": "Bot ID", - "value": "``" + client.user.id + "``", + "value": `\`${client.user.id}\``, "inline": true }, { @@ -81,12 +81,12 @@ module.exports = { }, { "name": "<:cpu:793672442056802354> CPU Type", - "value": process.arch + ", " + cpu.model() + "value": `${process.arch}, ${cpu.model()}` }, { "name": "<:hostos:793866961675223090> OS Type", - "value": process.platform + " / " + os.version() + "value": `${process.platform} / ${os.version()}` }, { "name": "<:node:793537507018145813> Node.JS Version", @@ -94,7 +94,7 @@ module.exports = { }, { "name": "<:hostinfo:793529505263517747> Bot Ping", - "value": Math.round(client.ws.ping) + " ms", + "value": `${Math.round(client.ws.ping)} ms`, "inline": true }, { diff --git a/commands/kiss.js b/commands/kiss.js index f8cd102..10e76ec 100644 --- a/commands/kiss.js +++ b/commands/kiss.js @@ -19,7 +19,7 @@ module.exports = { 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 + ">!", + "description": `${taggedUser} You have been kissed by ${message.author}!`, "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), diff --git a/commands/leskiss.js b/commands/leskiss.js index 45192f7..703ef79 100644 --- a/commands/leskiss.js +++ b/commands/leskiss.js @@ -29,7 +29,7 @@ module.exports = { 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 + ">! <:lesbian:803831629428686849>", + "description": `${taggedUser} You have been kissed by ${message.author}!`, "color": 8311585, "footer": { "icon_url": message.author.displayAvatarURL(), diff --git a/commands/lick.js b/commands/lick.js index b7a4748..3764f95 100644 --- a/commands/lick.js +++ b/commands/lick.js @@ -18,7 +18,7 @@ module.exports = { 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 + ">!", + "description": `${taggedUser} You have been licked by ${message.author}!`, "color": 8311585, "footer": { "icon_url": message.author.displayAvatarURL(), diff --git a/commands/nom.js b/commands/nom.js index ebb5ce4..73684b7 100644 --- a/commands/nom.js +++ b/commands/nom.js @@ -18,7 +18,7 @@ module.exports = { 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 + ">!", + "description": `${taggedUser} You have been nommed by ${message.author}!`, "color": 8311585, "footer": { "icon_url": message.author.displayAvatarURL(), diff --git a/commands/pat.js b/commands/pat.js index af031b5..b943223 100644 --- a/commands/pat.js +++ b/commands/pat.js @@ -17,7 +17,7 @@ module.exports = { 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 + ">!", + "description": `${taggedUser} You have been patted by ${message.author}!`, "color": 8311585, "footer": { "icon_url": message.author.displayAvatarURL(), diff --git a/commands/ping.js b/commands/ping.js index ef253d2..32c097a 100644 --- a/commands/ping.js +++ b/commands/ping.js @@ -9,7 +9,7 @@ module.exports = { await message.channel.send({embed:{ "title": ":ping_pong: Ping", - "description": "**Pong!** We pinged **" + pingLocation + "** and got " + client.ws.ping + " ms.", + "description": `**Pong!** We pinged **${pingLocation}** and got ${client.ws.ping} ms.`, "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), diff --git a/commands/poke.js b/commands/poke.js index 9334db8..2e77288 100644 --- a/commands/poke.js +++ b/commands/poke.js @@ -17,7 +17,7 @@ module.exports = { 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 + ">!", + "description": `${taggedUser} You have been poked by ${message.author}!`, "color": 8311585, "footer": { "icon_url": message.author.displayAvatarURL(), diff --git a/commands/slap.js b/commands/slap.js index 0f1564b..4fc6e9c 100644 --- a/commands/slap.js +++ b/commands/slap.js @@ -10,7 +10,7 @@ module.exports = { } else { await message.channel.send({embed: { "title": ":anger: Slap", - "description": "<@" + taggedUser + "> You have been slapped by <@" + message.author + ">!", + "description": `${taggedUser} You have been slapped by ${message.author}!`, "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), diff --git a/commands/snuggle.js b/commands/snuggle.js index b90a0cb..6d6285b 100644 --- a/commands/snuggle.js +++ b/commands/snuggle.js @@ -18,7 +18,7 @@ module.exports = { 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 + ">!", + "description": `${taggedUser} You have been snuggled by ${message.author}!`, "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), diff --git a/commands/uinfo.js b/commands/uinfo.js index 138c8a7..527e3fd 100644 --- a/commands/uinfo.js +++ b/commands/uinfo.js @@ -5,7 +5,7 @@ module.exports = { async execute(client, message, args, footerTxt) { 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 + "!", + "title": `Everything you've ever wanted to know about ${user.username}!`, "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), @@ -41,7 +41,7 @@ module.exports = { }, { "name": "User ID", - "value": "``" + user.id + "``" + "value": `\`${user.id}\`` }, { "name": "User Joined Discord", diff --git a/start.js b/start.js index e823731..117f0c0 100755 --- a/start.js +++ b/start.js @@ -30,16 +30,16 @@ client.generateErrorMessage = (errorMsg, messageAuthorURL) => ({embed: { ] }}) -client.on("error", (e) => console.log("[ERROR]" + error(e))); -client.on("warn", (e) => ("[WARN]" + warn(e))); +client.on("error", (e) => console.log(`[ERROR] ${error(e)}`)); +client.on("warn", (e) => (`[WARN] ${warn(e)}`)); client.once('ready', () => { console.clear() console.log(' ___ _ __ '); console.log(' / | ____ (_) /__________ _ __'); - console.log(' / /| | / __ \/ / __/ ___/ __ \| |/_/'); + console.log(' / /| | / __ \\/ / __/ ___/ __ \\| |/_/'); console.log(' / ___ |/ / / / / /_/ / / /_/ /> < '); - console.log('/_/ |_/_/ /_/_/\__/_/ \____/_/|_| ') - console.log(release + ", " + build) + console.log('/_/ |_/_/ /_/_/\\__/_/ \\____/_/|_| '); + console.log(`${release}, ${build}`); console.log("All Systems Go. | Anitrox by IDeletedSystem64 | ALL MY CODE KEEPS BLOWING UP!"); }); From 2206af796acf01d950a0ca87dd2c61bc9eb1d28b Mon Sep 17 00:00:00 2001 From: Nathaniel Mason Date: Sun, 27 Mar 2022 23:03:17 +0100 Subject: [PATCH 08/22] change all indentation to spaces --- commands/eval.js | 8 +++---- commands/info.js | 6 +++--- commands/invite.js | 10 ++++----- commands/reload.js | 12 +++++------ start.js | 54 +++++++++++++++++++++++----------------------- 5 files changed, 45 insertions(+), 45 deletions(-) diff --git a/commands/eval.js b/commands/eval.js index b94dde9..d98ac1d 100644 --- a/commands/eval.js +++ b/commands/eval.js @@ -2,10 +2,10 @@ const { inspect } = require("util"); module.exports = { - name: 'eval', - description: 'Runs js code', - async execute(_, message, args, footerTxt) { - if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { + name: 'eval', + description: 'Runs js code', + async execute(_, message, args, footerTxt) { + if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { try { const code = args.join(" "); const evaled = inspect(eval(code)); diff --git a/commands/info.js b/commands/info.js index a58b9d5..24eeecf 100644 --- a/commands/info.js +++ b/commands/info.js @@ -2,9 +2,9 @@ const {build, release} = require('../config.json'); module.exports = { - name: 'info', - description: 'Shows bot and host information', - async execute(client, message, _, footerTxt) { + name: 'info', + description: 'Shows bot and host information', + async execute(client, message, _, footerTxt) { function Uptime(uptime) { const totalSeconds = (uptime / 1000); diff --git a/commands/invite.js b/commands/invite.js index ce04d12..609357c 100644 --- a/commands/invite.js +++ b/commands/invite.js @@ -1,9 +1,9 @@ module.exports = { - name: 'invite', - description: 'Add Anitrox to your beautiful server!', - syntax: [], - async execute(_0, message, _1, footerTxt) { + name: 'invite', + description: 'Add Anitrox to your beautiful server!', + syntax: [], + async execute(_0, message, _1, footerTxt) { 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.", @@ -30,5 +30,5 @@ module.exports = { } ] }}); - }, + }, }; \ No newline at end of file diff --git a/commands/reload.js b/commands/reload.js index b04dbba..6f89903 100644 --- a/commands/reload.js +++ b/commands/reload.js @@ -1,8 +1,8 @@ module.exports = { - name: 'reload', - description: 'Reloads a command', - async execute(client, message, args, footerTxt) { - if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { + name: 'reload', + description: 'Reloads a command', + async execute(client, message, args, footerTxt) { + if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { if (!args.length) { await message.channel.send(client.generateErrorMessage("You forgot to provide anything to reload, you pillock",message.author.displayAvatarURL())); } @@ -43,6 +43,6 @@ module.exports = { } ] }}); - } - } + } + } }; \ No newline at end of file diff --git a/start.js b/start.js index 117f0c0..958cb8c 100755 --- a/start.js +++ b/start.js @@ -11,8 +11,8 @@ client.commands = new Discord.Collection(); const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js')); for (const file of commandFiles) { - const command = require(`./commands/${file}`); - client.commands.set(command.name, command); + const command = require(`./commands/${file}`); + client.commands.set(command.name, command); } client.generateErrorMessage = (errorMsg, messageAuthorURL) => ({embed: { @@ -33,47 +33,47 @@ client.generateErrorMessage = (errorMsg, messageAuthorURL) => ({embed: { client.on("error", (e) => console.log(`[ERROR] ${error(e)}`)); client.on("warn", (e) => (`[WARN] ${warn(e)}`)); client.once('ready', () => { - console.clear() - console.log(' ___ _ __ '); - console.log(' / | ____ (_) /__________ _ __'); - console.log(' / /| | / __ \\/ / __/ ___/ __ \\| |/_/'); - console.log(' / ___ |/ / / / / /_/ / / /_/ /> < '); - console.log('/_/ |_/_/ /_/_/\\__/_/ \\____/_/|_| '); - console.log(`${release}, ${build}`); - console.log("All Systems Go. | Anitrox by IDeletedSystem64 | ALL MY CODE KEEPS BLOWING UP!"); + console.clear() + console.log(' ___ _ __ '); + console.log(' / | ____ (_) /__________ _ __'); + console.log(' / /| | / __ \\/ / __/ ___/ __ \\| |/_/'); + console.log(' / ___ |/ / / / / /_/ / / /_/ /> < '); + console.log('/_/ |_/_/ /_/_/\\__/_/ \\____/_/|_| '); + console.log(`${release}, ${build}`); + console.log("All Systems Go. | Anitrox by IDeletedSystem64 | ALL MY CODE KEEPS BLOWING UP!"); }); setInterval(async () => { // Picks a status from the config file - const index = Math.floor(Math.random() * statuses.length); - await client.user.setActivity(statuses[index]); + const index = Math.floor(Math.random() * statuses.length); + await client.user.setActivity(statuses[index]); }, 20000); // Begin Command Handler client.on('message', async (message) => { - if (!message.content.startsWith(prefix) || message.author.bot) return; + if (!message.content.startsWith(prefix) || message.author.bot) return; - const args = message.content.slice(prefix.length).split(/ +/); - const command = args.shift().toLowerCase(); - - if (!client.commands.has(command)) return; + const args = message.content.slice(prefix.length).split(/ +/); + const command = args.shift().toLowerCase(); + + if (!client.commands.has(command)) return; - try { - await client.commands.get(command).execute(client, message, args, footerTxt); - } catch (error) { - console.stack; - message.channel.send({embed: { - "title": "<:AnitroxError:809651936563429416> **Something went wrong!**", - "description": error.stack, - "color": 13632027, + try { + await client.commands.get(command).execute(client, message, args, footerTxt); + } catch (error) { + console.stack; + message.channel.send({embed: { + "title": "<:AnitroxError:809651936563429416> **Something went wrong!**", + "description": error.stack, + "color": 13632027, "footer": { "icon_url": message.author.displayAvatarURL(), "text": footerTxt }, - }}); - } + }}); + } }); client.login(token); \ No newline at end of file From 88ac2d4ab0bb014b17a65258550fa8f8cb575912 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Sun, 27 Mar 2022 20:08:50 -0500 Subject: [PATCH 09/22] Fix uptimes returning with everything in days --- commands/info.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/commands/info.js b/commands/info.js index a58b9d5..e0ee274 100644 --- a/commands/info.js +++ b/commands/info.js @@ -14,10 +14,10 @@ module.exports = { const minutes = parseInt((totalSeconds % 3600) / 60); const seconds = parseInt(totalSeconds % 60); - const daystring = days + (days === 1 ? "day" : "days"); - const hourstring = hours + (hours === 1 ? "day" : "days"); - const minutetring = minutes + (minutes === 1 ? "day" : "days"); - const secondstring = seconds + (seconds === 1 ? "day" : "days"); + const daystring = days + (days === 1 ? " day" : " days"); + const hourstring = hours + (hours === 1 ? " hour" : " hours"); + const minutetring = minutes + (minutes === 1 ? " minute" : " minutes"); + const secondstring = seconds + (seconds === 1 ? " second" : " seconds"); return `${daystring}**, **${hourstring}**, **${minutetring}**, **${secondstring}`; } From 976ba50c38340c4921a72fb74b399bba93f6df75 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Mon, 28 Mar 2022 10:56:21 -0500 Subject: [PATCH 10/22] Move config to a single variable and pass it. --- start.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/start.js b/start.js index 117f0c0..b63d7f7 100755 --- a/start.js +++ b/start.js @@ -2,8 +2,8 @@ const fs = require('fs'); const Discord = require('discord.js'); -const { statuses, build, release, prefix, token, footerTxt } = require('./config.json'); - +// const { statuses, build, release, prefix, token, footerTxt } = require('./config.json'); +const config = require('./config.json'); console.log('Starting!') const client = new Discord.Client(); client.commands = new Discord.Collection(); @@ -24,7 +24,7 @@ client.generateErrorMessage = (errorMsg, messageAuthorURL) => ({embed: { }, "fields": [ { - "name": "Well that happened...", + "name": "Something went wrong!", "value": errorMsg } ] @@ -39,14 +39,14 @@ client.once('ready', () => { console.log(' / /| | / __ \\/ / __/ ___/ __ \\| |/_/'); console.log(' / ___ |/ / / / / /_/ / / /_/ /> < '); console.log('/_/ |_/_/ /_/_/\\__/_/ \\____/_/|_| '); - console.log(`${release}, ${build}`); - console.log("All Systems Go. | Anitrox by IDeletedSystem64 | ALL MY CODE KEEPS BLOWING UP!"); + console.log(`${config.release}, ${config.build}`); + console.log("Bot online. | Anitrox by IDeletedSystem64 | ALL MY CODE KEEPS BLOWING UP!"); }); setInterval(async () => { // Picks a status from the config file - const index = Math.floor(Math.random() * statuses.length); + const index = Math.floor(Math.random() * config.statuses.length); await client.user.setActivity(statuses[index]); }, 20000); @@ -61,7 +61,7 @@ client.on('message', async (message) => { if (!client.commands.has(command)) return; try { - await client.commands.get(command).execute(client, message, args, footerTxt); + await client.commands.get(command).execute(client, message, args, config); } catch (error) { console.stack; message.channel.send({embed: { @@ -70,10 +70,10 @@ client.on('message', async (message) => { "color": 13632027, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, }}); } }); -client.login(token); \ No newline at end of file +client.login(config.token); \ No newline at end of file From 268ceb9c4aab213ef0d415f3f4dfbcaa699ab95c Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Mon, 28 Mar 2022 12:39:27 -0500 Subject: [PATCH 11/22] Move everything to use config --- start.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/start.js b/start.js index b63d7f7..8ea0b95 100755 --- a/start.js +++ b/start.js @@ -20,7 +20,7 @@ client.generateErrorMessage = (errorMsg, messageAuthorURL) => ({embed: { "color": 13632027, "footer": { "icon_url": messageAuthorURL, - "text": footerTxt + "text": config.footerTxt }, "fields": [ { @@ -41,21 +41,22 @@ client.once('ready', () => { console.log('/_/ |_/_/ /_/_/\\__/_/ \\____/_/|_| '); console.log(`${config.release}, ${config.build}`); console.log("Bot online. | Anitrox by IDeletedSystem64 | ALL MY CODE KEEPS BLOWING UP!"); + // Statuses + setInterval(async () => { + // Picks a status from the config file + const index = Math.floor(Math.random() * config.statuses.length); + await client.user.setActivity(config.statuses[index]); + }, 20000); + }); -setInterval(async () => { - // Picks a status from the config file - const index = Math.floor(Math.random() * config.statuses.length); - await client.user.setActivity(statuses[index]); -}, 20000); - // Begin Command Handler client.on('message', async (message) => { - if (!message.content.startsWith(prefix) || message.author.bot) return; + if (!message.content.startsWith(config.prefix) || message.author.bot) return; - const args = message.content.slice(prefix.length).split(/ +/); + const args = message.content.slice(config.prefix.length).split(/ +/); const command = args.shift().toLowerCase(); if (!client.commands.has(command)) return; From 55be4eb4f8a71a7a646e0f8a518e1e9644e72141 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Mon, 28 Mar 2022 12:42:09 -0500 Subject: [PATCH 12/22] Stop should now end the process --- commands/stop.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/commands/stop.js b/commands/stop.js index a106573..95188bc 100644 --- a/commands/stop.js +++ b/commands/stop.js @@ -1,26 +1,27 @@ module.exports = { name: "stop", - description: "Stops the bot", - async execute(client, message, _, footerTxt) { - if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { + description: "IT'S TIME TO STOP!... the bot", + async execute(client, message, config) { + if (message.author.id == config.ownerID) { await message.channel.send({embed: { "title": " **Shutting Down...**", "description": "See you next time!", "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, }}); - client.destroy(); + console.log("The bot is shutting down! Bye bye!") + process.exit(); } else { await message.channel.send({embed: { - "title": ":AnitroxDenied: Access Denied", + "title": "<:AnitroxDenied:809651936642203668> 403 Forbidden", "description": "You need to be the bot owner to execute this command!", "color": 13632027, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, }}); } From 3b33f51c65097fb9d470493d549491563e5daf58 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Mon, 28 Mar 2022 13:05:34 -0500 Subject: [PATCH 13/22] Change icons and switch to using config for ID --- commands/reload.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/commands/reload.js b/commands/reload.js index b04dbba..f91bbb8 100644 --- a/commands/reload.js +++ b/commands/reload.js @@ -1,8 +1,8 @@ module.exports = { name: 'reload', description: 'Reloads a command', - async execute(client, message, args, footerTxt) { - if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { + async execute(client, message, args, config) { + if (message.author.id = config.ownerID) { if (!args.length) { await message.channel.send(client.generateErrorMessage("You forgot to provide anything to reload, you pillock",message.author.displayAvatarURL())); } @@ -19,7 +19,7 @@ module.exports = { try { const newCommand = require(`./${command.name}.js`); client.commands.set(newCommand.name, newCommand); - await message.channel.send(`<:NyabotSuccess:697211376740859914> **Reloaded \`${command.name}\` successfully!**`); + await message.channel.send(`<:AnitroxSuccess:809651936819019796> **Reloaded \`${command.name}\` successfully!**`); console.log(`User reloaded ${command.name}.`) } catch (error) { console.error(error); @@ -30,7 +30,7 @@ module.exports = { } else { message.channel.send({embed: { - "title": "<:NyabotDenied:697145462565896194> **Access is denied**", + "title": "<:AnitroxDenied:809651936642203668> **403 Forbidden**", "color": 13632027, "footer": { "icon_url": message.author.displayAvatarURL(), From e861e702c0233044746b7a22e69b4bdcc1f7a513 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Mon, 28 Mar 2022 13:06:41 -0500 Subject: [PATCH 14/22] Change to using config for ID --- commands/eval.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/commands/eval.js b/commands/eval.js index b94dde9..1b0983c 100644 --- a/commands/eval.js +++ b/commands/eval.js @@ -1,22 +1,21 @@ const { inspect } = require("util"); - module.exports = { name: 'eval', - description: 'Runs js code', - async execute(_, message, args, footerTxt) { - if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { + description: 'Executes JS code', + async execute(_, message, args, config) { + if (message.author.id == config.ownerID) { try { const code = args.join(" "); const evaled = inspect(eval(code)); await message.channel.send(evaled, {code:"xl"}); } catch (error) { await message.channel.send({embed: { - "title": "<:NyabotError:697145462347661412> **Well that happened...**", + "title": "<:AnitroxError:809651936563429416> **Something went wrong! **", "color": 13632027, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "fields": [ { From 9eb8bd3d355072b527938fc57da3e353c2022ca5 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Mon, 28 Mar 2022 23:55:13 -0500 Subject: [PATCH 15/22] Change how it gets locations from config --- commands/ping.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/commands/ping.js b/commands/ping.js index 32c097a..b12e186 100644 --- a/commands/ping.js +++ b/commands/ping.js @@ -1,19 +1,17 @@ -const { locations } = require('../config.json'); - module.exports = { name: "ping", description: "Gets bot ping", - async execute(client, message, _, footerTxt) { - const index = Math.floor(Math.random() * locations.length); - const pingLocation = locations[index] + async execute(client, message, args, config) { + const index = Math.floor(Math.random() * config.locations.length); + const location = config.locations[index] await message.channel.send({embed:{ "title": ":ping_pong: Ping", - "description": `**Pong!** We pinged **${pingLocation}** and got ${client.ws.ping} ms.`, + "description": `**Pong!** We pinged **${location}** and got ${client.ws.ping} ms.`, "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt } }}); } From f5f9cdf0e2c5d1132010170c0fcd7182e33e1bd5 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Tue, 29 Mar 2022 11:06:04 -0500 Subject: [PATCH 16/22] Move answers to config JSON --- commands/8ball.js | 36 ++++++++---------------------------- config-example.json | 44 ++++++++++++++++++++++++++++++++------------ 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/commands/8ball.js b/commands/8ball.js index c514b2e..cd58d94 100644 --- a/commands/8ball.js +++ b/commands/8ball.js @@ -1,47 +1,27 @@ -const answers = [ - "Heck no!", - "Are you crazy!? No!", - "Don't even think about it.", - "No! You might bork something!", - "Heck yeah", - "I don't think so.", - "Let me think about it first. No.", - "Let me think about it first. Yeah", - "Let me think about it first. Maybe", - "I don't know man", - "Maybe", - "I'm not sure", - "Ask again", - "YEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE!!!", - "Definitely!", - "Go for it! :smile:", - "Good idea!", - "Sure" -] - module.exports = { name: '8ball', description: 'Ask Anitrox a question, any question! and they will answer it!', syntax: ["[Question]"], - async execute(client, message, args, footerTxt) { - const answer = answers[Math.floor(Math.random() * Object.keys(answers).length)]; + async execute(client, message, args, config) { + const index = Math.floor(Math.random() * config.answers.length); + const answer = config.answers[index] const question = args.slice(0).join(" ") if (!question) { await message.channel.send(client.generateErrorMessage("You need to ask a question!", message.author.displayAvatarURL)); } else { await message.channel.send({embed: { - "title": ":8ball: Anitrox 8 Ball", - "description": `Your question: **${question}**`, + "title": ":8ball: 8Ball", + "description": `Your amazing question: **${question}**`, "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "fields": [ { - "name": "🤔 My Answer", - "value": answer + "name": "Answer", + "value": `${answer}` } ] }}); diff --git a/config-example.json b/config-example.json index e8786e6..47afd8f 100644 --- a/config-example.json +++ b/config-example.json @@ -21,17 +21,37 @@ "VLC Media Player", "Chromium" ], - "locations": [ - "Microsoft", - "LinusTechTips", - "Linus Torvalds", - "borkeonv2", - "Google", - "192.168.1.1", - "127.0.0.1", - "Sophie's computer", - "Mars", - "Elon Musk", - "TMC Software" + "locations": [ + "Microsoft", + "LinusTechTips", + "Linus Torvalds", + "borkeonv2", + "Google", + "192.168.1.1", + "127.0.0.1", + "Sophie's computer", + "Mars", + "Elon Musk", + "TMC Software" + ], + "answers": [ + "Heck no!", + "Are you crazy!? No!", + "Don't even think about it.", + "No! You might bork something!", + "Heck yeah", + "I don't think so.", + "Let me think about it first. No.", + "Let me think about it first. Yeah", + "Let me think about it first. Maybe", + "I don't know man", + "Maybe", + "I'm not sure", + "Ask again", + "YEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE!!!", + "Definitely!", + "Go for it! :smile:", + "Good idea!", + "Sure" ] } \ No newline at end of file From 4312a2e0757da63f25c8a51c1bc3ba7545e4286f Mon Sep 17 00:00:00 2001 From: Nathaniel Mason Date: Tue, 29 Mar 2022 19:51:43 +0100 Subject: [PATCH 17/22] change footerTxt to config.footerTxt --- commands/avatar.js | 4 ++-- commands/bonk.js | 4 ++-- commands/cheese.js | 4 ++-- commands/cuddle.js | 4 ++-- commands/help.js | 4 ++-- commands/hug.js | 4 ++-- commands/info.js | 4 ++-- commands/invite.js | 4 ++-- commands/kiss.js | 4 ++-- commands/leskiss.js | 4 ++-- commands/lick.js | 4 ++-- commands/nom.js | 4 ++-- commands/opensource.js | 4 ++-- commands/pat.js | 4 ++-- commands/ping.js | 2 +- commands/poke.js | 4 ++-- commands/reload.js | 2 +- commands/setnick.js | 4 ++-- commands/slap.js | 4 ++-- commands/snuggle.js | 4 ++-- commands/uinfo.js | 4 ++-- start.js | 1 - 22 files changed, 40 insertions(+), 41 deletions(-) diff --git a/commands/avatar.js b/commands/avatar.js index 5db6668..356265b 100644 --- a/commands/avatar.js +++ b/commands/avatar.js @@ -2,7 +2,7 @@ module.exports = { name: "avatar", description: "Gets a user's avatar.", - async execute(client, message, args, footerTxt) { + async execute(client, message, args, config) { const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author; @@ -11,7 +11,7 @@ module.exports = { "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": user.displayAvatarURL() diff --git a/commands/bonk.js b/commands/bonk.js index ab0a7c4..d4d984c 100644 --- a/commands/bonk.js +++ b/commands/bonk.js @@ -2,7 +2,7 @@ module.exports = { name: "bonk", description: "Bonks a user!", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -14,7 +14,7 @@ module.exports = { "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": "https://cdn.discordapp.com/attachments/793537380330111028/801194481549312060/HappyBONK.gif" diff --git a/commands/cheese.js b/commands/cheese.js index ff3da46..88516d2 100644 --- a/commands/cheese.js +++ b/commands/cheese.js @@ -1,7 +1,7 @@ module.exports = { name: "cheese", description: "Cheese an user, or run just ``n!cheese`` for a surprise :eyes:", - async execute(_0, message, _1, footerTxt) { + 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"); @@ -12,7 +12,7 @@ module.exports = { "color": 16312092, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": "https://cdn.discordapp.com/attachments/803658122299572255/812867714368536636/R06325af354168febcafd96b8328b7590.png" diff --git a/commands/cuddle.js b/commands/cuddle.js index 35f0183..d14cb10 100644 --- a/commands/cuddle.js +++ b/commands/cuddle.js @@ -9,7 +9,7 @@ module.exports = { name: "cuddle", description: "Cuddle an user!", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); const index = Math.floor(Math.random() * gifchoices.length); @@ -24,7 +24,7 @@ module.exports = { "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": gif diff --git a/commands/help.js b/commands/help.js index 1a622fa..940501b 100644 --- a/commands/help.js +++ b/commands/help.js @@ -4,14 +4,14 @@ module.exports = { description: 'Get help on anything from commands, to what the bot does! just not your homework..', syntax: '', - async execute(_0, message, _1, footerTxt) { + 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": `${footerTxt} | No mother it's just the northern lights` + "text": `${config.footerTxt} | No mother it's just the northern lights` }, "fields": [ { diff --git a/commands/hug.js b/commands/hug.js index 1d95374..a4ddf72 100644 --- a/commands/hug.js +++ b/commands/hug.js @@ -10,7 +10,7 @@ module.exports = { name: "hug", description: "Hugs a user!", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -23,7 +23,7 @@ module.exports = { "color": 8311585, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": gif diff --git a/commands/info.js b/commands/info.js index f999f7d..4707580 100644 --- a/commands/info.js +++ b/commands/info.js @@ -4,7 +4,7 @@ module.exports = { name: 'info', description: 'Shows bot and host information', - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { function Uptime(uptime) { const totalSeconds = (uptime / 1000); @@ -31,7 +31,7 @@ module.exports = { "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "thumbnail": { "url": client.user.displayAvatarURL() diff --git a/commands/invite.js b/commands/invite.js index 609357c..873e385 100644 --- a/commands/invite.js +++ b/commands/invite.js @@ -3,14 +3,14 @@ module.exports = { name: 'invite', description: 'Add Anitrox to your beautiful server!', syntax: [], - async execute(_0, message, _1, footerTxt) { + 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": footerTxt + "text": config.footerTxt }, "thumbnail": { "url": "https://cdn.discordapp.com/attachments/803658122299572255/814352905394061322/anitroxaddsrvr.png" diff --git a/commands/kiss.js b/commands/kiss.js index 10e76ec..6b51e9a 100644 --- a/commands/kiss.js +++ b/commands/kiss.js @@ -10,7 +10,7 @@ module.exports = { name: "kiss", description: "Kisses a user!", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -23,7 +23,7 @@ module.exports = { "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": gif diff --git a/commands/leskiss.js b/commands/leskiss.js index 703ef79..18242c4 100644 --- a/commands/leskiss.js +++ b/commands/leskiss.js @@ -20,7 +20,7 @@ module.exports = { name: "leskiss", description: "Lesbian kiss <:lesbian:803831629428686849>", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -33,7 +33,7 @@ module.exports = { "color": 8311585, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": gif diff --git a/commands/lick.js b/commands/lick.js index 3764f95..f3573ac 100644 --- a/commands/lick.js +++ b/commands/lick.js @@ -9,7 +9,7 @@ module.exports = { name: "lick", description: "Licks a user!", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -22,7 +22,7 @@ module.exports = { "color": 8311585, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": "https://cdn.discordapp.com/attachments/803658122299572255/805314244123951114/cef569820773b0f5d54ee34cfa18e1f8.gif" diff --git a/commands/nom.js b/commands/nom.js index 73684b7..1ace929 100644 --- a/commands/nom.js +++ b/commands/nom.js @@ -9,7 +9,7 @@ module.exports = { name: "nom", description: "Noms an user!", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -22,7 +22,7 @@ module.exports = { "color": 8311585, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": gif diff --git a/commands/opensource.js b/commands/opensource.js index 8b14c43..762a6c1 100644 --- a/commands/opensource.js +++ b/commands/opensource.js @@ -1,14 +1,14 @@ module.exports = { name: 'opensource', description: 'Attributions to open source components used by Anitrox', - async execute(_0, message, _1, footerTxt){ + async execute(_0, message, _1, config){ await message.channel.send({embed: { "title": "Component Attribution", "description": "Some parts of Anitrox are using open source code, and their attributions are avaliable here!", "color": 52508, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "thumbnail": { "url": "https://cdn.discordapp.com/attachments/803658122299572255/838854256471703602/793885335498522685.png" diff --git a/commands/pat.js b/commands/pat.js index b943223..1d818a0 100644 --- a/commands/pat.js +++ b/commands/pat.js @@ -8,7 +8,7 @@ module.exports = { name: "pat", description: "Pats a user!", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -21,7 +21,7 @@ module.exports = { "color": 8311585, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": gif diff --git a/commands/ping.js b/commands/ping.js index b12e186..77f9544 100644 --- a/commands/ping.js +++ b/commands/ping.js @@ -1,7 +1,7 @@ module.exports = { name: "ping", description: "Gets bot ping", - async execute(client, message, args, config) { + async execute(client, message, _, config) { const index = Math.floor(Math.random() * config.locations.length); const location = config.locations[index] diff --git a/commands/poke.js b/commands/poke.js index 2e77288..46584ba 100644 --- a/commands/poke.js +++ b/commands/poke.js @@ -8,7 +8,7 @@ module.exports = { name: "poke", description: "Pokes a user!", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -21,7 +21,7 @@ module.exports = { "color": 8311585, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": gif diff --git a/commands/reload.js b/commands/reload.js index 6bd8f2c..84de5cd 100644 --- a/commands/reload.js +++ b/commands/reload.js @@ -34,7 +34,7 @@ module.exports = { "color": 13632027, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "fields": [ { diff --git a/commands/setnick.js b/commands/setnick.js index efa1e1c..3569904 100644 --- a/commands/setnick.js +++ b/commands/setnick.js @@ -1,7 +1,7 @@ module.exports = { name: 'setnick', description: 'Sets your nickname', - async execute(client, message, args, footerTxt) { + async execute(client, message, args, config) { if (message.channel.permissionsFor(message.author).has("CHANGE_NICKNAME")) { const newnick = args.slice(0).join(" ") @@ -13,7 +13,7 @@ module.exports = { "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "fields": [ { diff --git a/commands/slap.js b/commands/slap.js index 4fc6e9c..8e1d41b 100644 --- a/commands/slap.js +++ b/commands/slap.js @@ -2,7 +2,7 @@ module.exports = { name: "slap", description: "Slaps an user!", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -14,7 +14,7 @@ module.exports = { "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": "https://media1.tenor.com/images/b6d8a83eb652a30b95e87cf96a21e007/tenor.gif?itemid=10426943" diff --git a/commands/snuggle.js b/commands/snuggle.js index 6d6285b..cda8b8a 100644 --- a/commands/snuggle.js +++ b/commands/snuggle.js @@ -9,7 +9,7 @@ module.exports = { name: "snuggle", description: "Snuggle an user!", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -22,7 +22,7 @@ module.exports = { "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": gif diff --git a/commands/uinfo.js b/commands/uinfo.js index 527e3fd..f7427a0 100644 --- a/commands/uinfo.js +++ b/commands/uinfo.js @@ -2,14 +2,14 @@ module.exports = { name: "uinfo", description: "Gets info about an user, such as ID, Discord Join date and more", syntax: "", - async execute(client, message, args, footerTxt) { + 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": footerTxt + "text": config.footerTxt }, "thumbnail": { "url": user.displayAvatarURL() diff --git a/start.js b/start.js index 2c92a2b..9dfde1a 100755 --- a/start.js +++ b/start.js @@ -2,7 +2,6 @@ const fs = require('fs'); const Discord = require('discord.js'); -// const { statuses, build, release, prefix, token, footerTxt } = require('./config.json'); const config = require('./config.json'); console.log('Starting!') const client = new Discord.Client(); From aaae385763d01a03fe6e93cbeab9f78c9c16fe48 Mon Sep 17 00:00:00 2001 From: Nathaniel Mason Date: Tue, 29 Mar 2022 19:55:44 +0100 Subject: [PATCH 18/22] use config param instead of require --- commands/info.js | 6 ++---- commands/restart.js | 4 +--- commands/stop.js | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/commands/info.js b/commands/info.js index 4707580..4ae2ae4 100644 --- a/commands/info.js +++ b/commands/info.js @@ -1,5 +1,3 @@ -const {build, release} = require('../config.json'); - module.exports = { name: 'info', @@ -43,12 +41,12 @@ module.exports = { }, { "name": "Release Type", - "value": release, + "value": config.release, "inline": true }, { "name": "Release Version", - "value": build, + "value": config.build, "inline": true }, { diff --git a/commands/restart.js b/commands/restart.js index 2cd54c2..237e03c 100644 --- a/commands/restart.js +++ b/commands/restart.js @@ -1,5 +1,3 @@ -const { token } = require('../config.json'); - module.exports = { name: 'restart', description: '(Owner Only) Shuts down the bot.', @@ -8,7 +6,7 @@ module.exports = { await message.channel.send(" Restarting...") try { client.destroy(); - await client.login(token); + await client.login(config.token); await message.channel.send("<:NyabotSuccess:697211376740859914> Restart Successful") console.log("All systems go") } catch(e) {console.log(e);} diff --git a/commands/stop.js b/commands/stop.js index 95188bc..5fa179c 100644 --- a/commands/stop.js +++ b/commands/stop.js @@ -1,7 +1,7 @@ module.exports = { name: "stop", description: "IT'S TIME TO STOP!... the bot", - async execute(client, message, config) { + async execute(_, message, config) { if (message.author.id == config.ownerID) { await message.channel.send({embed: { "title": " **Shutting Down...**", From 31ee6be7f6999f3f199ee633cf60510393bbcaa8 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Tue, 29 Mar 2022 12:41:49 -0500 Subject: [PATCH 19/22] Revert "Fix uptimes returning with everything in days" This reverts commit 88ac2d4ab0bb014b17a65258550fa8f8cb575912. --- commands/info.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/commands/info.js b/commands/info.js index 4ae2ae4..8de64ff 100644 --- a/commands/info.js +++ b/commands/info.js @@ -12,10 +12,10 @@ module.exports = { const minutes = parseInt((totalSeconds % 3600) / 60); const seconds = parseInt(totalSeconds % 60); - const daystring = days + (days === 1 ? " day" : " days"); - const hourstring = hours + (hours === 1 ? " 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 ? "day" : "days"); + const minutetring = minutes + (minutes === 1 ? "day" : "days"); + const secondstring = seconds + (seconds === 1 ? "day" : "days"); return `${daystring}**, **${hourstring}**, **${minutetring}**, **${secondstring}`; } From b1d763d4250359e0dfa31627c5613d5c0f86dc05 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Tue, 29 Mar 2022 18:13:06 -0500 Subject: [PATCH 20/22] Fix shit --- commands/info.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/info.js b/commands/info.js index 8de64ff..5ae1be0 100644 --- a/commands/info.js +++ b/commands/info.js @@ -13,9 +13,9 @@ module.exports = { const seconds = parseInt(totalSeconds % 60); const daystring = days + (days === 1 ? "day" : "days"); - const hourstring = hours + (hours === 1 ? "day" : "days"); - const minutetring = minutes + (minutes === 1 ? "day" : "days"); - const secondstring = seconds + (seconds === 1 ? "day" : "days"); + const 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}`; } From ee7b194d8321502963aff496179dfd0da758f6bd Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Tue, 29 Mar 2022 18:53:55 -0500 Subject: [PATCH 21/22] Fix missing args causing config issues --- commands/restart.js | 7 ++++--- commands/stop.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/commands/restart.js b/commands/restart.js index 237e03c..2c78ca6 100644 --- a/commands/restart.js +++ b/commands/restart.js @@ -1,8 +1,9 @@ module.exports = { name: 'restart', - description: '(Owner Only) Shuts down the bot.', - async execute(client, message) { - if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { + description: 'Restarts the bot', + async execute(client, message, args, config) { + if (message.author.id == config.ownerID) { + console.log("Anitrox is restarting now!") await message.channel.send(" Restarting...") try { client.destroy(); diff --git a/commands/stop.js b/commands/stop.js index 5fa179c..f47c4cb 100644 --- a/commands/stop.js +++ b/commands/stop.js @@ -1,7 +1,7 @@ module.exports = { name: "stop", description: "IT'S TIME TO STOP!... the bot", - async execute(_, message, config) { + async execute(_, message, args, config) { if (message.author.id == config.ownerID) { await message.channel.send({embed: { "title": " **Shutting Down...**", From e0a7891b4adcb9f45b72978a06a68be9d5dc22d8 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Tue, 29 Mar 2022 19:04:20 -0500 Subject: [PATCH 22/22] Pass client to eval --- commands/eval.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/eval.js b/commands/eval.js index 1b0983c..cad5859 100644 --- a/commands/eval.js +++ b/commands/eval.js @@ -3,7 +3,7 @@ module.exports = { name: 'eval', description: 'Executes JS code', - async execute(_, message, args, config) { + async execute(client, message, args, config) { if (message.author.id == config.ownerID) { try { const code = args.join(" ");