diff --git a/commands/8ball.js b/commands/8ball.js index cd58d94..2748458 100644 --- a/commands/8ball.js +++ b/commands/8ball.js @@ -1,7 +1,9 @@ module.exports = { - name: '8ball', + + name: require('path').parse(__filename).name, description: 'Ask Anitrox a question, any question! and they will answer it!', syntax: ["[Question]"], + async execute(client, message, args, config) { const index = Math.floor(Math.random() * config.answers.length); const answer = config.answers[index] diff --git a/commands/avatar.js b/commands/avatar.js index 356265b..615ce63 100644 --- a/commands/avatar.js +++ b/commands/avatar.js @@ -1,11 +1,11 @@ module.exports = { - name: "avatar", + name: require('path').parse(__filename).name, description: "Gets a user's avatar.", - async execute(client, message, args, config) { - - const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author; + async execute(client, message, args, config) { + const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author; + await message.channel.send({embed: { "title": `:frame_photo: ${user.username}'s Beautiful Avatar!`, "color": 9442302, diff --git a/commands/bonk.js b/commands/bonk.js index d4d984c..87dc359 100644 --- a/commands/bonk.js +++ b/commands/bonk.js @@ -1,7 +1,8 @@ module.exports = { - - name: "bonk", + + name: require('path').parse(__filename).name, description: "Bonks a user!", + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); diff --git a/commands/cheese.js b/commands/cheese.js index 88516d2..c3b2f59 100644 --- a/commands/cheese.js +++ b/commands/cheese.js @@ -1,8 +1,11 @@ module.exports = { - name: "cheese", + + name: require('path').parse(__filename).name, description: "Cheese an user, or run just ``n!cheese`` for a surprise :eyes:", + async execute(_0, message, _1, config) { const taggedUser = message.mentions.users.first(); + if(!taggedUser) { await message.channel.send("*slams cheese on desk*\n**Cheese.** https://www.youtube.com/watch?v=Or4IE8fkpn4"); } else { diff --git a/commands/choose.js b/commands/choose.js index 5e5f953..178ff5d 100644 --- a/commands/choose.js +++ b/commands/choose.js @@ -1,11 +1,13 @@ module.exports = { - name: 'choose', + + name: require('path').parse(__filename).name, description: "Give some lines of input, and get one back at random", + async execute(client, message, _, config) { var strarr = message.content.split(/\s*\n\s*/); strarr[0] = strarr[0].slice(this.name.length + config.prefix.length); - console.log(strarr); const answer = strarr[Math.floor(Math.random() * strarr.length)]; + if (answer === "") { await message.channel.send(client.generateErrorMessage("You need to provide some input!", message.author.displayAvatarURL())); } else { diff --git a/commands/cuddle.js b/commands/cuddle.js index d14cb10..5825a73 100644 --- a/commands/cuddle.js +++ b/commands/cuddle.js @@ -7,10 +7,10 @@ const gifchoices = [ module.exports = { - name: "cuddle", + name: require('path').parse(__filename).name, description: "Cuddle an user!", - async execute(client, message, _, config) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); const index = Math.floor(Math.random() * gifchoices.length); const gif = (gifchoices[index]); diff --git a/commands/eval.js b/commands/eval.js index 1b0983c..86b0f18 100644 --- a/commands/eval.js +++ b/commands/eval.js @@ -1,8 +1,10 @@ const { inspect } = require("util"); + module.exports = { - name: 'eval', + name: require('path').parse(__filename).name, description: 'Executes JS code', + async execute(_, message, args, config) { if (message.author.id == config.ownerID) { try { diff --git a/commands/help.js b/commands/help.js index 940501b..e2bd143 100644 --- a/commands/help.js +++ b/commands/help.js @@ -1,6 +1,6 @@ module.exports = { - name: 'help', + name: require('path').parse(__filename).name, description: 'Get help on anything from commands, to what the bot does! just not your homework..', syntax: '', diff --git a/commands/hug.js b/commands/hug.js index a4ddf72..c294752 100644 --- a/commands/hug.js +++ b/commands/hug.js @@ -8,8 +8,9 @@ const gifchoices = [ module.exports = { - name: "hug", + name: require('path').parse(__filename).name, description: "Hugs a user!", + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); diff --git a/commands/info.js b/commands/info.js index bd8a39b..41ce529 100644 --- a/commands/info.js +++ b/commands/info.js @@ -1,28 +1,29 @@ +function Uptime(uptime) { + const totalSeconds = (uptime / 1000); + + const days = parseInt(totalSeconds / 86400); + const hours = parseInt((totalSeconds % 86400) / 3600); + 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"); + + return `${daystring}**, **${hourstring}**, **${minutetring}**, **${secondstring}`; +} + module.exports = { - name: 'info', + name: require('path').parse(__filename).name, description: 'Shows bot and host information', + async execute(client, message, _, config) { - - function Uptime(uptime) { - const totalSeconds = (uptime / 1000); - - const days = parseInt(totalSeconds / 86400); - const hours = parseInt((totalSeconds % 86400) / 3600); - 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"); - - return `${daystring}**, **${hourstring}**, **${minutetring}**, **${secondstring}`; - } - const os = require("os"); const osu = require('node-os-utils'); const cpu = osu.cpu; + await message.channel.send({embed: { "title": "<:AnitroxInfo:809651936831733791> Information about Anitrox", "description": "Everything you've ever wanted to know about your favorite bot, Anitrox!", diff --git a/commands/invite.js b/commands/invite.js index 873e385..a17a2c8 100644 --- a/commands/invite.js +++ b/commands/invite.js @@ -1,8 +1,9 @@ module.exports = { - name: 'invite', + name: require('path').parse(__filename).name, description: 'Add Anitrox to your beautiful server!', syntax: [], + async execute(_0, message, _1, config) { await message.channel.send({embed: { "title": "Add Anitrox to your Server!", diff --git a/commands/kiss.js b/commands/kiss.js index 6b51e9a..f37ff13 100644 --- a/commands/kiss.js +++ b/commands/kiss.js @@ -8,7 +8,7 @@ const gifchoices = [ module.exports = { - name: "kiss", + name: require('path').parse(__filename).name, description: "Kisses a user!", async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); diff --git a/commands/leskiss.js b/commands/leskiss.js index 18242c4..69c60db 100644 --- a/commands/leskiss.js +++ b/commands/leskiss.js @@ -18,7 +18,7 @@ const gifchoices = [ module.exports = { - name: "leskiss", + name: require('path').parse(__filename).name, description: "Lesbian kiss <:lesbian:803831629428686849>", async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); diff --git a/commands/lick.js b/commands/lick.js index f3573ac..fd762be 100644 --- a/commands/lick.js +++ b/commands/lick.js @@ -7,7 +7,7 @@ const gifchoices = [ module.exports = { - name: "lick", + name: require('path').parse(__filename).name, description: "Licks a user!", async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); diff --git a/commands/nom.js b/commands/nom.js index 1ace929..e3b9e7b 100644 --- a/commands/nom.js +++ b/commands/nom.js @@ -7,7 +7,7 @@ const gifchoices = [ module.exports = { - name: "nom", + name: require('path').parse(__filename).name, description: "Noms an user!", async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); diff --git a/commands/opensource.js b/commands/opensource.js index 762a6c1..3b9dc16 100644 --- a/commands/opensource.js +++ b/commands/opensource.js @@ -1,6 +1,8 @@ module.exports = { - name: 'opensource', - description: 'Attributions to open source components used by Anitrox', + + name: require('path').parse(__filename).name, + description: 'Attributions to open source components used by Anitrox', + async execute(_0, message, _1, config){ await message.channel.send({embed: { "title": "Component Attribution", diff --git a/commands/pat.js b/commands/pat.js index 1d818a0..27a7db1 100644 --- a/commands/pat.js +++ b/commands/pat.js @@ -6,8 +6,9 @@ const gifchoices = [ module.exports = { - name: "pat", + name: require('path').parse(__filename).name, description: "Pats a user!", + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); diff --git a/commands/ping.js b/commands/ping.js index 77f9544..df10b93 100644 --- a/commands/ping.js +++ b/commands/ping.js @@ -1,6 +1,8 @@ module.exports = { - name: "ping", + + name: require('path').parse(__filename).name, description: "Gets bot ping", + async execute(client, message, _, config) { const index = Math.floor(Math.random() * config.locations.length); const location = config.locations[index] diff --git a/commands/poke.js b/commands/poke.js index 46584ba..346ab47 100644 --- a/commands/poke.js +++ b/commands/poke.js @@ -6,8 +6,9 @@ const gifchoices = [ module.exports = { - name: "poke", + name: require('path').parse(__filename).name, description: "Pokes a user!", + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); diff --git a/commands/reload.js b/commands/reload.js index 84de5cd..05f048d 100644 --- a/commands/reload.js +++ b/commands/reload.js @@ -1,6 +1,8 @@ module.exports = { - name: 'reload', + + name: require('path').parse(__filename).name, description: 'Reloads a command', + async execute(client, message, args, config) { if (message.author.id = config.ownerID) { if (!args.length) { diff --git a/commands/restart.js b/commands/restart.js index fafd9e2..d048849 100644 --- a/commands/restart.js +++ b/commands/restart.js @@ -1,6 +1,8 @@ module.exports = { - name: 'restart', + + name: require('path').parse(__filename).name, description: 'Restarts the bot', + async execute(client, message, _, config) { if (message.author.id == config.ownerID) { console.log("Anitrox is restarting now!") diff --git a/commands/setnick.js b/commands/setnick.js index 3569904..a097ed1 100644 --- a/commands/setnick.js +++ b/commands/setnick.js @@ -1,11 +1,11 @@ module.exports = { - name: 'setnick', + + name: require('path').parse(__filename).name, description: 'Sets your nickname', + async execute(client, message, args, config) { - if (message.channel.permissionsFor(message.author).has("CHANGE_NICKNAME")) { const newnick = args.slice(0).join(" ") - try { await message.member.setNickname(newnick, "Nickname change requested by the server member. If you don't want users to be able to change their nickname disable 'CHANGE_NICKNAME' via Change Nickname in Roles.") await message.channel.send({embed: { diff --git a/commands/slap.js b/commands/slap.js index 8e1d41b..f390d06 100644 --- a/commands/slap.js +++ b/commands/slap.js @@ -1,7 +1,8 @@ module.exports = { - name: "slap", + name: require('path').parse(__filename).name, description: "Slaps an user!", + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); diff --git a/commands/snuggle.js b/commands/snuggle.js index cda8b8a..e94afb9 100644 --- a/commands/snuggle.js +++ b/commands/snuggle.js @@ -7,8 +7,9 @@ const gifchoices = [ module.exports = { - name: "snuggle", + name: require('path').parse(__filename).name, description: "Snuggle an user!", + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); diff --git a/commands/stop.js b/commands/stop.js index 2631741..9e11f13 100644 --- a/commands/stop.js +++ b/commands/stop.js @@ -1,6 +1,8 @@ module.exports = { - name: "stop", + + name: require('path').parse(__filename).name, description: "IT'S TIME TO STOP!... the bot", + async execute(_0, message, _1, config) { if (message.author.id == config.ownerID) { await message.channel.send({embed: { diff --git a/commands/uinfo.js b/commands/uinfo.js index f7427a0..aa20282 100644 --- a/commands/uinfo.js +++ b/commands/uinfo.js @@ -1,9 +1,12 @@ module.exports = { - name: "uinfo", + + name: require('path').parse(__filename).name, description: "Gets info about an user, such as ID, Discord Join date and more", syntax: "", + 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,