From 4b80768a8f50e2eea82f0d81dec445c9d91660f1 Mon Sep 17 00:00:00 2001 From: night0721 Date: Thu, 24 Jun 2021 15:53:19 +0800 Subject: [PATCH] Updated configs and added api --- .gitattributes | 2 + api/app.js | 20 +++ api/routes/commands.js | 8 + api/routes/routes.js | 4 + cat/Path/fantastic.js | 6 +- cat/Path/fight.js | 11 +- cat/Path/gae.js | 6 +- cat/Path/gg.js | 6 +- cat/Path/how.js | 6 +- cat/Path/nab.js | 6 +- cat/Path/pp.js | 8 +- commands/Config/check.js | 5 - commands/Config/choices.js | 5 - commands/Config/cmd-list.js | 5 - commands/Config/create.js | 5 - commands/Config/delete.js | 5 - commands/Config/disable.js | 5 - commands/Config/enable.js | 5 - commands/Config/migrate.js | 5 - commands/Config/modmail-category.js | 5 - commands/Config/modmail-role.js | 5 - commands/Config/panel.js | 5 - commands/Config/prefix-reset.js | 5 - commands/Config/prefix.js | 5 - commands/Config/premium.js | 5 - commands/Config/rr-add.js | 5 - commands/Config/rr-rmv.js | 5 - commands/Config/set.js | 22 ++- commands/Economy/bal.js | 5 - commands/Economy/bet.js | 25 +-- commands/Economy/buy.js | 7 +- commands/Economy/daily.js | 9 +- commands/Economy/drop.js | 5 - commands/Economy/gift.js | 7 +- commands/Economy/give.js | 5 - commands/Economy/inv.js | 7 +- commands/Economy/lb.js | 5 - commands/Economy/shop.js | 9 +- commands/Economy/slots.js | 8 +- commands/Economy/steal.js | 5 - commands/Economy/work.js | 5 - commands/{Utilities => Fun}/8ball.js | 11 +- commands/Fun/cat.js | 5 - commands/Fun/coinflip.js | 8 +- commands/Fun/connect4.js | 5 - commands/Fun/dog.js | 5 - commands/Fun/drake.js | 6 +- commands/Fun/ds.js | 18 +++ commands/Fun/hangman.js | 5 - commands/{Utilities => Fun}/hexcolor.js | 4 +- commands/Fun/hug.js | 5 - commands/Fun/kiss.js | 5 - commands/Fun/meme.js | 5 - commands/Fun/quote.js | 41 +++++ commands/Fun/rickroll.js | 30 ++++ commands/Fun/say.js | 5 - commands/Fun/simprate.js | 5 - commands/Fun/sr.js | 15 ++ commands/Fun/triggered.js | 18 +++ commands/Giveaway/end.js | 5 - commands/Giveaway/giveaway.js | 7 +- commands/Giveaway/reroll.js | 5 - commands/Moderation/announce.js | 5 - commands/Moderation/ban.js | 5 - commands/Moderation/clear.js | 5 - commands/Moderation/clearWarns.js | 5 - commands/Moderation/kick.js | 5 - commands/Moderation/lock.js | 5 - commands/Moderation/mute.js | 5 - commands/Moderation/nuke.js | 5 - commands/Moderation/pin.js | 5 - commands/Moderation/removeWarn.js | 5 - commands/Moderation/role.js | 5 - commands/Moderation/slowmode.js | 5 - commands/Moderation/unban.js | 5 - commands/Moderation/unlock.js | 5 - commands/Moderation/unmute.js | 5 - commands/Moderation/warn.js | 5 - commands/Moderation/warns.js | 5 - commands/Music/leave.js | 9 +- commands/Music/loop.js | 5 - commands/Music/lyrics.js | 7 +- commands/Music/nowplaying.js | 5 - commands/Music/pause.js | 5 - commands/Music/play.js | 5 - commands/Music/playlist.js | 5 - commands/Music/queue.js | 7 +- commands/Music/remove.js | 7 +- commands/Music/resume.js | 6 +- commands/Music/shuffle.js | 5 - commands/Music/skip.js | 5 - commands/Music/skipto.js | 5 - commands/Music/stop.js | 5 - commands/Music/volume.js | 5 - commands/Owner/accept.js | 6 - commands/Owner/add.js | 5 - commands/Owner/blacklist.js | 5 - commands/Owner/cls.js | 10 ++ commands/Owner/deny.js | 6 - commands/Owner/dm.js | 5 - commands/Owner/encrypt.js | 5 - commands/Owner/eval.js | 5 - commands/Owner/getinvite.js | 5 - commands/Owner/guilds.js | 7 +- commands/Owner/premium.js | 5 - commands/Owner/reaction-role.js | 9 +- commands/Owner/restart.js | 14 +- commands/Owner/rmv.js | 5 - commands/Owner/setBotAvatar.js | 5 - commands/Owner/status.js | 5 - commands/Owner/try.js | 11 +- commands/Utilities/afk.js | 7 +- commands/Utilities/avatar.js | 7 +- commands/Utilities/botinfo.js | 5 - commands/Utilities/choose.js | 5 - commands/Utilities/emoji.js | 5 - commands/Utilities/emojiadd.js | 27 ++-- commands/Utilities/esnipe.js | 5 - commands/Utilities/help.js | 176 ++++++++------------- commands/Utilities/invite.js | 29 ++-- commands/Utilities/permission.js | 5 - commands/Utilities/poll.js | 5 - commands/Utilities/rank.js | 41 +++++ commands/Utilities/report.js | 5 - commands/Utilities/servericon.js | 5 - commands/Utilities/serverinfo.js | 5 - commands/Utilities/snipe.js | 8 +- commands/Utilities/suggest.js | 5 - commands/Utilities/support.js | 16 -- commands/Utilities/timer.js | 5 - commands/Utilities/userinfo.js | 35 ++--- config.json | 2 +- events/afk.js | 5 +- events/emoji.js | 9 +- events/goodBye.js | 2 +- events/guild.js | 2 +- events/guildCreate.js | 5 +- events/guildDelete.js | 9 +- events/level.js | 2 +- events/log.js | 0 events/message.js | 50 +++--- events/messageUpdate.js | 2 +- events/messsageDelete.js | 2 +- events/reactionroles.js | 2 +- events/ready.js | 2 +- events/slash.js | 4 +- index.js | 124 ++------------- models/guilds.js | 7 +- package-lock.json | 198 +++--------------------- package.json | 4 +- util/dist/bash.sh | 24 +++ util/dist/cmds.js | 39 +++++ util/{ => dist}/err.js | 7 +- util/{ => dist}/item.js | 22 +-- util/functions/mongoose.js | 34 ++-- util/{ => pagination}/pagify.js | 0 util/{ => pagination}/pagination.js | 0 157 files changed, 581 insertions(+), 1161 deletions(-) create mode 100644 .gitattributes create mode 100644 api/app.js create mode 100644 api/routes/commands.js create mode 100644 api/routes/routes.js rename commands/{Utilities => Fun}/8ball.js (84%) create mode 100644 commands/Fun/ds.js rename commands/{Utilities => Fun}/hexcolor.js (96%) create mode 100644 commands/Fun/quote.js create mode 100644 commands/Fun/rickroll.js create mode 100644 commands/Fun/sr.js create mode 100644 commands/Fun/triggered.js create mode 100644 commands/Owner/cls.js create mode 100644 commands/Utilities/rank.js delete mode 100644 commands/Utilities/support.js create mode 100644 events/log.js create mode 100644 util/dist/bash.sh create mode 100644 util/dist/cmds.js rename util/{ => dist}/err.js (96%) rename util/{ => dist}/item.js (57%) rename util/{ => pagination}/pagify.js (100%) rename util/{ => pagination}/pagination.js (100%) diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/api/app.js b/api/app.js new file mode 100644 index 0000000..ee14c5a --- /dev/null +++ b/api/app.js @@ -0,0 +1,20 @@ +const express = require("express"); +const app = express(); +const port = process.env.PORT || 3001; +const routes = require("./routes/routes"); +const client = require("../bot"); +client.on("ready", async () => { + var users = client.guilds.cache.reduce((a, b) => a + b.memberCount, 0); + var guilds = client.guilds.cache.size; + const caches = { + users: users, + guilds: guilds, + }; + app.use("/api", routes); + app.use("/client", async (req, res) => { + res.status(200).send(caches); + }); + app.listen(port, () => { + console.log(`Listen on PORT ${port}`); + }); +}); diff --git a/api/routes/commands.js b/api/routes/commands.js new file mode 100644 index 0000000..1946d9d --- /dev/null +++ b/api/routes/commands.js @@ -0,0 +1,8 @@ +const { cmds } = require("../../util/dist/cmds"); +const commands = cmds(); +const router = require("express").Router(); + +router.get("/", async (req, res) => { + res.status(200).send(commands); +}); +module.exports = router; diff --git a/api/routes/routes.js b/api/routes/routes.js new file mode 100644 index 0000000..3d2ff71 --- /dev/null +++ b/api/routes/routes.js @@ -0,0 +1,4 @@ +const router = require("express").Router(); +const cmds = require("./commands"); +router.use("/commands", cmds); +module.exports = router; diff --git a/cat/Path/fantastic.js b/cat/Path/fantastic.js index 430d863..df3ff93 100644 --- a/cat/Path/fantastic.js +++ b/cat/Path/fantastic.js @@ -2,11 +2,7 @@ const { Client, Message, MessageEmbed } = require("discord.js"); module.exports = { name: "fantastic", timeout: 60000, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ + run: async (client, message, args) => { message.delete(); const player = args.join(" "); diff --git a/cat/Path/fight.js b/cat/Path/fight.js index 806bbdd..f85404d 100644 --- a/cat/Path/fight.js +++ b/cat/Path/fight.js @@ -3,11 +3,7 @@ module.exports = { name: "fight", description: "Goooooooooooooooolag!", timeout: 15000, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ + run: async (client, message, args) => { const gaes = [ "Gae", @@ -60,12 +56,15 @@ module.exports = { "a Bot", "locknload with 200 round RPD gae", "ros gae", + "Cath Gae", + "Cat drinking a cat gae", + "Night Gae", ]; const gae = gaes[Math.floor(Math.random() * gaes.length)]; const embed = new MessageEmbed() .setTitle("**Gulag Fight**") .setDescription( - `**${message.author}has taken a chance at redemption in The Gulag. \nYou fight only to find out that you're \`${gae}\`. If you somehow turned out to not be gae, DM an admin to get your timer halved ||only if your mute is less than 69m||**` + `**${message.author} has taken a chance at redemption in The Gulag. \nYou fight only to find out that you're \`${gae}\`. If you somehow turned out to not be gae, DM an admin to get your timer halved ||only if your mute is less than 69m||**` ) .setColor(5198940); message.channel.send(embed); diff --git a/cat/Path/gae.js b/cat/Path/gae.js index 4b04293..4adb457 100644 --- a/cat/Path/gae.js +++ b/cat/Path/gae.js @@ -2,11 +2,7 @@ const { Client, Message, MessageEmbed } = require("discord.js"); module.exports = { name: "gae", timeout: 15000, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ + run: async (client, message, args) => { const MEE6 = [ "u = gae", diff --git a/cat/Path/gg.js b/cat/Path/gg.js index ace24fb..f3df604 100644 --- a/cat/Path/gg.js +++ b/cat/Path/gg.js @@ -2,11 +2,7 @@ const { Client, Message, MessageEmbed } = require("discord.js"); module.exports = { name: "gg", timeout: 15000, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ + run: async (client, message, args) => { const GG = [ "**GIT GUD**", diff --git a/cat/Path/how.js b/cat/Path/how.js index 931939a..1f326fd 100644 --- a/cat/Path/how.js +++ b/cat/Path/how.js @@ -4,11 +4,7 @@ module.exports = { description: "Check how gae is the user", usage: "(User)", Path: true, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ + run: async (client, message, args) => { const target = message.mentions.users.first() || message.author; if (target.id === "366562874039992331") { diff --git a/cat/Path/nab.js b/cat/Path/nab.js index cfde741..77b57f2 100644 --- a/cat/Path/nab.js +++ b/cat/Path/nab.js @@ -2,11 +2,7 @@ const { Client, Message, MessageEmbed } = require("discord.js"); module.exports = { name: "nab", timeout: 15000, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ + run: async (client, message, args) => { const NAB = [ "stop being a nab, nab", diff --git a/cat/Path/pp.js b/cat/Path/pp.js index 8168639..e688c4e 100644 --- a/cat/Path/pp.js +++ b/cat/Path/pp.js @@ -3,11 +3,7 @@ module.exports = { name: "pp", description: "Check how long is the user", usage: "(User)", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ + run: async (client, message, args) => { let user = message.mentions.users.first() || message.author; let embed = new MessageEmbed() @@ -18,7 +14,7 @@ module.exports = { .setColor(client.color) .setTitle("Peepee size machine") .setTimestamp() - .setFooter(`Made by Cath Team`); + .setFooter(`Made by ${client.author}`); message.inlineReply(embed); }, }; diff --git a/commands/Config/check.js b/commands/Config/check.js index 46d379e..59e01b9 100644 --- a/commands/Config/check.js +++ b/commands/Config/check.js @@ -5,11 +5,6 @@ module.exports = { usage: "(goodbye/welcome/log) (Channel)", UserPerm: "ADMINISTRATOR", category: "Config", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const data = await client.data.getGuild(message.guild.id); if (!args[0]) return client.err(messgae, "Config", "check", 45); diff --git a/commands/Config/choices.js b/commands/Config/choices.js index 9b37b39..f8fee49 100644 --- a/commands/Config/choices.js +++ b/commands/Config/choices.js @@ -6,11 +6,6 @@ module.exports = { description: "Add choices for modmail in a server", usage: "(add/list/rmv) (Emoji) {Text}", category: "Config", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { schema.findOne({ Guild: message.guild.id }, async (err, data) => { if (data) return; diff --git a/commands/Config/cmd-list.js b/commands/Config/cmd-list.js index ebd11ce..5f22306 100644 --- a/commands/Config/cmd-list.js +++ b/commands/Config/cmd-list.js @@ -6,11 +6,6 @@ module.exports = { UserPerm: "ADMINISTRATOR", description: "Check the custom commands in a server", category: "Config", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const data = await schema.find({ Guild: message.guild.id }); if (!!data === false) return client.err(messgae, "Config", "cmd-list", 10); diff --git a/commands/Config/create.js b/commands/Config/create.js index 4377385..abb4e2b 100644 --- a/commands/Config/create.js +++ b/commands/Config/create.js @@ -6,11 +6,6 @@ module.exports = { UserPerm: "ADMINISTRATOR", description: "Crate custom commands for a server", category: "Config", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { message.delete(); message.channel.send( diff --git a/commands/Config/delete.js b/commands/Config/delete.js index f852ce7..73c7cb8 100644 --- a/commands/Config/delete.js +++ b/commands/Config/delete.js @@ -6,11 +6,6 @@ module.exports = { usage: "(command)", description: "Delete a custom command for a server", category: "Config", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const name = args[0]; if (!name) return client.err(message, "Config", "cc-delete", 47); diff --git a/commands/Config/disable.js b/commands/Config/disable.js index c9ba731..39bb2a8 100644 --- a/commands/Config/disable.js +++ b/commands/Config/disable.js @@ -6,11 +6,6 @@ module.exports = { usage: "(Command/Category) (Name)", description: "Disable a command in a server", category: "Config", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const type = args[0].toLowerCase(); if (!type) return client.err(message, "Config", "disable", 17); diff --git a/commands/Config/enable.js b/commands/Config/enable.js index 3156ddf..c6ea93b 100644 --- a/commands/Config/enable.js +++ b/commands/Config/enable.js @@ -6,11 +6,6 @@ module.exports = { usage: "(Command) {Channel}", description: "Enable a command in a server", category: "Config", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const type = args[0].toLowerCase(); const name = args[1].toLowerCase(); diff --git a/commands/Config/migrate.js b/commands/Config/migrate.js index 5f9ecc0..cf021ba 100644 --- a/commands/Config/migrate.js +++ b/commands/Config/migrate.js @@ -4,11 +4,6 @@ module.exports = { usage: "(Server ID)", description: "Migrate all emojis from a server", category: "Config", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { try { const oldGuild = args[0]; diff --git a/commands/Config/modmail-category.js b/commands/Config/modmail-category.js index 279ec48..ddfefc6 100644 --- a/commands/Config/modmail-category.js +++ b/commands/Config/modmail-category.js @@ -7,11 +7,6 @@ module.exports = { description: "Setup modmail category in a server", usage: "(Category ID)", category: "Config", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { if (!args.length) return client.err(message, "Config", "modmail-category", 0); diff --git a/commands/Config/modmail-role.js b/commands/Config/modmail-role.js index aad2d70..42ffd05 100644 --- a/commands/Config/modmail-role.js +++ b/commands/Config/modmail-role.js @@ -6,11 +6,6 @@ module.exports = { description: "Add role for modmail in a server", usage: "(Role)", category: "Config", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { if (!args.length) return client.err(message, "Config", "modmail-role", 0); const role = diff --git a/commands/Config/panel.js b/commands/Config/panel.js index 422c369..3b66369 100644 --- a/commands/Config/panel.js +++ b/commands/Config/panel.js @@ -6,11 +6,6 @@ module.exports = { description: "Reaction-Role Panel", UserPerm: "ADMINISTRATOR", category: "Config", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const channel = message.mentions.channels.first() || message.channel; Schema.findOne({ Guild: message.guild.id }, async (err, data) => { diff --git a/commands/Config/prefix-reset.js b/commands/Config/prefix-reset.js index db27202..39f85e4 100644 --- a/commands/Config/prefix-reset.js +++ b/commands/Config/prefix-reset.js @@ -7,11 +7,6 @@ module.exports = { description: 'Reset the prefix to "C." at the server', UserPerm: "ADMINISTRATOR", category: "Config", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message) => { message.channel .send("**Do you want to reset your prefix?**") diff --git a/commands/Config/prefix.js b/commands/Config/prefix.js index 789719e..d1f38d5 100644 --- a/commands/Config/prefix.js +++ b/commands/Config/prefix.js @@ -6,11 +6,6 @@ module.exports = { description: "Set the prefix at the server", UserPerm: "ADMINISTRATOR", category: "Config", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const res = args.join(" "); if (!res) return client.err(message, "Config", "prefix", 46); diff --git a/commands/Config/premium.js b/commands/Config/premium.js index 6026f99..63f4e27 100644 --- a/commands/Config/premium.js +++ b/commands/Config/premium.js @@ -6,11 +6,6 @@ module.exports = { aliases: ["psadd", "psa", "premiumserver"], description: "Add premium to a server", Premium: true, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { try { const user = await client.data.getUser(message.author.id); diff --git a/commands/Config/rr-add.js b/commands/Config/rr-add.js index 87e3e72..29149cc 100644 --- a/commands/Config/rr-add.js +++ b/commands/Config/rr-add.js @@ -6,11 +6,6 @@ module.exports = { description: "Create reaction role for server", usage: "(Role) (emoji(Must be in server)", category: "Config", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const role = message.mentions.roles.first() || diff --git a/commands/Config/rr-rmv.js b/commands/Config/rr-rmv.js index e053337..7aef15f 100644 --- a/commands/Config/rr-rmv.js +++ b/commands/Config/rr-rmv.js @@ -6,11 +6,6 @@ module.exports = { UserPerm: "ADMINISTRATOR", description: "Remove reaction role for server", category: "Config", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { message.channel .send("**Do you want to remove the reaction roles?**") diff --git a/commands/Config/set.js b/commands/Config/set.js index 1430444..44658a3 100644 --- a/commands/Config/set.js +++ b/commands/Config/set.js @@ -5,11 +5,6 @@ module.exports = { usage: "(goodbye/welcome/log) (#Channel)", UserPerm: "ADMINISTRATOR", category: "Config", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { if (!args[0]) return client.err(message, "Config", "set", 45); if (args[0].toLowerCase() === "goodbye") { @@ -20,7 +15,22 @@ module.exports = { } else if (args[0].toLowerCase() === "log") { const channel = message.mentions.channels.first(); if (!channel) return client.err(message, "Config", "set", 28); - await client.data.setLog(message.guild.id, channel.id); + let webhookid; + let webhooktoken; + await channel + .createWebhook(message.guild.name, { + avatar: message.guild.iconURL({ format: "png" }), + }) + .then(webhook => { + webhookid = webhook.id; + webhooktoken = webhook.token; + }); + await client.data.setLog( + message.guild.id, + channel.id, + webhookid, + webhooktoken + ); message.channel.send(`Saved ${channel} as the log channel.`); } else if (args[0].toLowerCase() === "welcome") { const channel = message.mentions.channels.first(); diff --git a/commands/Economy/bal.js b/commands/Economy/bal.js index 04f11d5..3e5855e 100644 --- a/commands/Economy/bal.js +++ b/commands/Economy/bal.js @@ -4,11 +4,6 @@ module.exports = { aliases: ["bal"], usage: "(User)", category: "Economy", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const user = message.mentions.members.first() || diff --git a/commands/Economy/bet.js b/commands/Economy/bet.js index ec95a6c..cfe3df6 100644 --- a/commands/Economy/bet.js +++ b/commands/Economy/bet.js @@ -6,25 +6,20 @@ module.exports = { timeout: 5000, description: "Win double amount of coins or lose all coins", category: "Economy", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const max = 1000000; if (!args[0]) { - return client.err(message, "Economy", "gamble", 5); + return client.err(message, "Economy", "bet", 5); } if (isNaN(args[0])) { - return client.err(message, "Economy", "gamble", 7); + return client.err(message, "Economy", "bet", 7); } const amt = parseInt(args[0]); if ((await client.data.bal(message.author.id)) < amt) { - return client.err(message, "Economy", "gamble", 20); + return client.err(message, "Economy", "bet", 20); } if (amt > max) { - return client.err(message, "Economy", "gamble", 101); + return client.err(message, "Economy", "bet", 101); } if (client.function.random() === true) { const winamt = amt * 1; @@ -33,7 +28,11 @@ module.exports = { .setColor("GREEN") .setTimestamp() .setTitle(`${message.author.username} wins a gamble game`) - .setDescription(`You win\n**${winamt}**${client.currency}`); + .setDescription( + `You win\n**${winamt}**${client.currency}\nYou now have **${ + parseInt(await client.data.bal(message.author.id)) - amt + }**${client.currency}` + ); message.inlineReply(abc); } else { await client.data.rmv(message.author.id, amt); @@ -41,7 +40,11 @@ module.exports = { .setColor("RED") .setTimestamp() .setTitle(`${message.author.username} loses a gamble game`) - .setDescription(`You lost\n**${amt}**${client.currency}`); + .setDescription( + `You lost\n**${winamt}**${client.currency}\nYou now have **${ + parseInt(await client.data.bal(message.author.id)) - amt + }**${client.currency}` + ); message.inlineReply(cba); } }, diff --git a/commands/Economy/buy.js b/commands/Economy/buy.js index 41e6ca8..fec9b11 100644 --- a/commands/Economy/buy.js +++ b/commands/Economy/buy.js @@ -1,17 +1,12 @@ const { Client, Message, MessageEmbed } = require("discord.js"); const inventory = require("../../models/econ"); -const items = require("../../util/item"); +const items = require("../../util/dist/item"); module.exports = { name: "purchase", aliases: ["buy"], usage: "(Item)", description: "Buy something from the shop", category: "Economy", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { if (!args[0]) { return client.err(message, "Economy", "buy", 21); diff --git a/commands/Economy/daily.js b/commands/Economy/daily.js index ab240bf..7b7b7f4 100644 --- a/commands/Economy/daily.js +++ b/commands/Economy/daily.js @@ -4,11 +4,6 @@ module.exports = { description: "Earns daily money", category: "Economy", timeout: 1000 * 60 * 60 * 24, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { var money; const user = await client.data.getUser(message.author.id); @@ -25,7 +20,7 @@ module.exports = { ) .setURL(client.web) .setColor(client.color) - .setFooter(`Made by Cath Team`) + .setFooter(`Made by ${client.author}`) .setTimestamp(); await client.data.add(message.author.id, money); return message.inlineReply(pre_embed); @@ -41,7 +36,7 @@ module.exports = { ) .setURL(client.web) .setColor(client.color) - .setFooter(`Made by Cath Team`) + .setFooter(`Made by ${client.author}`) .setTimestamp(); await client.data.add(message.author.id, money); return message.inlineReply(norm_embed); diff --git a/commands/Economy/drop.js b/commands/Economy/drop.js index 0e0c6a7..e18c950 100644 --- a/commands/Economy/drop.js +++ b/commands/Economy/drop.js @@ -5,11 +5,6 @@ module.exports = { usage: "{Channel} (Number)", description: "Drops money to a channel", category: "Economy", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const p = await client.prefix(message); const channel = message.mentions.channels.first() || message.channel; diff --git a/commands/Economy/gift.js b/commands/Economy/gift.js index c152ea6..75b78fb 100644 --- a/commands/Economy/gift.js +++ b/commands/Economy/gift.js @@ -1,17 +1,12 @@ const { Client, Message, MessageEmbed } = require("discord.js"); const inventory = require("../../models/econ"); -const items = require("../../util/item"); +const items = require("../../util/dist/item"); module.exports = { name: "gift", timeout: 5000, usage: "(User) (Item)", description: "Gift item to an user", category: "Economy", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const user = message.mentions.users.first() || diff --git a/commands/Economy/give.js b/commands/Economy/give.js index 4a25ba0..b3acd36 100644 --- a/commands/Economy/give.js +++ b/commands/Economy/give.js @@ -6,11 +6,6 @@ module.exports = { usage: "(User) (Number)", description: "Give money to an user", category: "Economy", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const user = message.mentions.users.first() || diff --git a/commands/Economy/inv.js b/commands/Economy/inv.js index e98f84e..230cbfe 100644 --- a/commands/Economy/inv.js +++ b/commands/Economy/inv.js @@ -1,6 +1,6 @@ const { Client, Message, MessageEmbed } = require("discord.js"); const inv = require("../../models/econ"); -const util = require("../../util/pagination"); +const util = require("../../util/pagination/pagination"); module.exports = { name: "inventory", aliases: ["inv"], @@ -8,11 +8,6 @@ module.exports = { usage: "{User}", category: "Economy", timeout: 5000, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const p = await client.prefix(message); const user = diff --git a/commands/Economy/lb.js b/commands/Economy/lb.js index 65331f6..db0335a 100644 --- a/commands/Economy/lb.js +++ b/commands/Economy/lb.js @@ -6,11 +6,6 @@ module.exports = { timeout: 5000, usage: "Check the leaderboard of a server", category: "Economy", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const rawLeaderboard = await Levels.fetchLeaderboard(message.guild.id, 10); if (rawLeaderboard.length < 1) diff --git a/commands/Economy/shop.js b/commands/Economy/shop.js index ec857ad..5158015 100644 --- a/commands/Economy/shop.js +++ b/commands/Economy/shop.js @@ -1,15 +1,10 @@ const { Client, Message, MessageEmbed } = require("discord.js"); -const util = require("../../util/pagination"); -const items = require("../../util/item"); +const util = require("../../util/pagination/pagination"); +const items = require("../../util/dist/item"); module.exports = { name: "shop", description: "Check the items from the shop", category: "Economy", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const list = items.map((value, index) => { return `**${value.item}** — ${value.price.toLocaleString()}${ diff --git a/commands/Economy/slots.js b/commands/Economy/slots.js index 765bc55..9c15dac 100644 --- a/commands/Economy/slots.js +++ b/commands/Economy/slots.js @@ -5,11 +5,6 @@ module.exports = { timeout: 5000, description: "Win more coins by slots", category: "Economy", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const max = 1000000; const slots = [ @@ -81,12 +76,11 @@ module.exports = { ) .setTitle(`${message.author.username} loses a slots game`) .setDescription( - `You lose\n**${amt}**${client.currency}\nYou now have **${ + `You lost\n**${amt}**${client.currency}\nYou now have **${ parseInt(await client.data.bal(message.author.id)) - amt }**${client.currency}` ); message.inlineReply(lost); - console.log(`Coins: ${await client.data.bal(message.author.id)}`); } }, }; diff --git a/commands/Economy/steal.js b/commands/Economy/steal.js index 3a06cbd..9286771 100644 --- a/commands/Economy/steal.js +++ b/commands/Economy/steal.js @@ -7,11 +7,6 @@ module.exports = { aliases: ["rob"], category: "Economy", timeout: 120000, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { var tryrob = message.mentions.users.first() || diff --git a/commands/Economy/work.js b/commands/Economy/work.js index f6e7de5..47097a2 100644 --- a/commands/Economy/work.js +++ b/commands/Economy/work.js @@ -5,11 +5,6 @@ module.exports = { description: "Work to earn money", category: "Economy", timeout: 1000 * 60 * 10, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const job = [ "Software engineer", diff --git a/commands/Utilities/8ball.js b/commands/Fun/8ball.js similarity index 84% rename from commands/Utilities/8ball.js rename to commands/Fun/8ball.js index 2776925..5cb1218 100644 --- a/commands/Utilities/8ball.js +++ b/commands/Fun/8ball.js @@ -31,15 +31,10 @@ module.exports = { name: "8ball", usage: "(Question)", description: "8ball an answer", - category: "Utilities", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ + category: "Fun", run: async (client, message, args) => { if (!args.join(" ").endsWith("?")) - return client.err(message, "Utilities", "8ball", 101); + return client.err(message, "Fun", "8ball", 101); else { const embed = new MessageEmbed() .setAuthor( @@ -54,7 +49,7 @@ module.exports = { .setColor(client.color) .setTimestamp() .setURL(client.web) - .setFooter("Made by Cath Team"); + .setFooter(`Made by ${client.author}`); message.inlineReply(embed); } }, diff --git a/commands/Fun/cat.js b/commands/Fun/cat.js index afaa658..40e941a 100644 --- a/commands/Fun/cat.js +++ b/commands/Fun/cat.js @@ -5,11 +5,6 @@ module.exports = { aliases: ["cats"], category: "Fun", description: "A cat command", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const wait = await message.inlineReply("Getting cat picture..."); let subreddits = ["cat", "cats"]; diff --git a/commands/Fun/coinflip.js b/commands/Fun/coinflip.js index 7655cf6..34100b1 100644 --- a/commands/Fun/coinflip.js +++ b/commands/Fun/coinflip.js @@ -3,11 +3,7 @@ module.exports = { name: "coinflip", aliases: ["cf"], description: "Flip a coin", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ + category: "Fun", run: async (client, message, args) => { let HT = ["Heads!", "Tails!"]; let pick = HT[Math.floor(Math.random() * HT.length)]; @@ -15,7 +11,7 @@ module.exports = { .setColor(client.color) .setTitle("CoinFilp Game") .setTimestamp() - .setFooter(`Made by Cath Team`) + .setFooter(`Made by ${client.author}`) .setDescription(pick); message.inlineReply(embed); }, diff --git a/commands/Fun/connect4.js b/commands/Fun/connect4.js index 0d83dec..a6b5a31 100644 --- a/commands/Fun/connect4.js +++ b/commands/Fun/connect4.js @@ -5,11 +5,6 @@ module.exports = { usage: "(User)", description: "Play a connect 4 game with a user", category: "Fun", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const challenger = message.member; const oppenent = message.mentions.members.first(); diff --git a/commands/Fun/dog.js b/commands/Fun/dog.js index bf3df65..b14fad2 100644 --- a/commands/Fun/dog.js +++ b/commands/Fun/dog.js @@ -5,11 +5,6 @@ module.exports = { aliases: ["dogs"], category: "Fun", description: "A dog command", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const wait = await message.inlineReply("Getting dog picture..."); let subreddits = ["dog", "dogs"]; diff --git a/commands/Fun/drake.js b/commands/Fun/drake.js index 45330e7..305a65c 100644 --- a/commands/Fun/drake.js +++ b/commands/Fun/drake.js @@ -9,11 +9,7 @@ module.exports = { name: "drake", description: "Drake meme", usage: "(Text) (Text)", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ + category: "Fun", run: async (client, message, args) => { const t1 = args[0]; const t2 = args.slice(1).join(" "); diff --git a/commands/Fun/ds.js b/commands/Fun/ds.js new file mode 100644 index 0000000..3f22020 --- /dev/null +++ b/commands/Fun/ds.js @@ -0,0 +1,18 @@ +const fetch = require("node-fetch"); +const { Client, Message, MessageEmbed } = require("discord.js"); +module.exports = { + name: "ds", + aliases: ["doublestruck"], + description: "Doublestruck your text", + usage: "(text)", + category: "Fun", + run: async (client, message, args) => { + let text = args.join("+"); + if (!text) return client.err(message, "Fun", "ds", 12); + let res = await fetch( + "https://api.popcatdev.repl.co/doublestruck?text=" + text + ); + let json = await res.json(); + message.inlineReply(json.text); + }, +}; diff --git a/commands/Fun/hangman.js b/commands/Fun/hangman.js index 9d14f3b..1de8918 100644 --- a/commands/Fun/hangman.js +++ b/commands/Fun/hangman.js @@ -6,11 +6,6 @@ module.exports = { name: "hangman", description: "Play a hangman game", category: "Fun", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { if (playing.has(message.channel.id)) return message.reply("Only one game may be occurring per channel."); diff --git a/commands/Utilities/hexcolor.js b/commands/Fun/hexcolor.js similarity index 96% rename from commands/Utilities/hexcolor.js rename to commands/Fun/hexcolor.js index 6abd6d9..2e8165e 100644 --- a/commands/Utilities/hexcolor.js +++ b/commands/Fun/hexcolor.js @@ -12,14 +12,14 @@ module.exports = { usage: "(Hex Color Code)", description: "Get Hex and RGB info of a color", aliases: ["hex"], - category: "Utilities", + category: "Fun", run: async (client, message, args) => { let color; if (args[0]) { if (/(#|0x)([0-9A-F]{6})/i.test(args[0])) { color = args[0].match(/(#|0x)([0-9A-F]{6})/i)[2]; } else { - return client.err(message, "Utilities", "hexcolor", 101); + return client.err(message, "Fun", "hexcolor", 101); } } else { color = message.member.displayHexColor; diff --git a/commands/Fun/hug.js b/commands/Fun/hug.js index d66f389..12220e8 100644 --- a/commands/Fun/hug.js +++ b/commands/Fun/hug.js @@ -4,11 +4,6 @@ module.exports = { usage: "(User)", description: "Hug someone", category: "Fun", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const words = args.slice(1).join(" "); const user = diff --git a/commands/Fun/kiss.js b/commands/Fun/kiss.js index 753fbb7..095f228 100644 --- a/commands/Fun/kiss.js +++ b/commands/Fun/kiss.js @@ -4,11 +4,6 @@ module.exports = { usage: "(User)", description: "Kiss someone", category: "Fun", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const words = args.slice(1).join(" "); const user = diff --git a/commands/Fun/meme.js b/commands/Fun/meme.js index 919bc65..d7bc090 100644 --- a/commands/Fun/meme.js +++ b/commands/Fun/meme.js @@ -5,11 +5,6 @@ module.exports = { aliases: ["memes"], category: "Fun", description: "A meme command", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const wait = await message.inlineReply("Getting meme..."); let subreddits = ["comedyheaven", "dank", "meme", "memes"]; diff --git a/commands/Fun/quote.js b/commands/Fun/quote.js new file mode 100644 index 0000000..cb05e49 --- /dev/null +++ b/commands/Fun/quote.js @@ -0,0 +1,41 @@ +const { + Client, + Message, + MessageEmbed, + MessageAttachment, +} = require("discord.js"); +const { Canvas } = require("canvacord"); +module.exports = { + name: "quote", + description: "Quote a message", + usage: "{User} (Message)", + category: "Fun", + run: async (client, message, args) => { + const member = message.mentions.users.first() || message.author; + if (message.mentions.users.first()) { + const imgae = await Canvas.quote({ + image: member.displayAvatarURL({ + format: "png", + }), + message: args.slice(1).join(" "), + username: member.displayName ? member.displayName : member.username, + color: "ffffff", + }); + const attach = new MessageAttachment(imgae, "quote.png"); + message.inlineReply(attach); + } else { + const imgae = await Canvas.quote({ + image: message.author.displayAvatarURL({ + format: "png", + }), + message: args.join(" "), + username: message.member.nickname + ? message.member.nickname + : member.username, + color: "ffffff", + }); + const attach = new MessageAttachment(imgae, "quote.png"); + message.inlineReply(attach); + } + }, +}; diff --git a/commands/Fun/rickroll.js b/commands/Fun/rickroll.js new file mode 100644 index 0000000..d4cbb66 --- /dev/null +++ b/commands/Fun/rickroll.js @@ -0,0 +1,30 @@ +const { + Client, + Message, + MessageEmbed, + MessageAttachment, +} = require("discord.js"); + +module.exports = { + name: "rickroll", + aliases: ["rick", "nevergonnagiveyouup", "never"], + description: "Rickroll?", + category: "Fun", + run: async (client, message, args) => { + const roll = [ + "Never gonna give you up", + "Never gonna let you down", + "Never gonna run around and desert you", + "Never gonna make you cry", + "Never gonna say goodbye", + "Never gonna tell a lie and hurt you", + ]; + const rick = roll[Math.floor(Math.random() * roll.length)]; + const rickroll = new MessageAttachment( + "https://i.pinimg.com/originals/88/82/bc/8882bcf327896ab79fb97e85ae63a002.gif" + ); + message.inlineReply(`**${rick}**`, { + files: [rickroll], + }); + }, +}; diff --git a/commands/Fun/say.js b/commands/Fun/say.js index 1ba09a0..25cbdf5 100644 --- a/commands/Fun/say.js +++ b/commands/Fun/say.js @@ -4,11 +4,6 @@ module.exports = { description: "Pretend a bot to say", usage: "(Words)", category: "Fun", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { if (!args.length) return; message.delete(); diff --git a/commands/Fun/simprate.js b/commands/Fun/simprate.js index 7f52d93..4cfe924 100644 --- a/commands/Fun/simprate.js +++ b/commands/Fun/simprate.js @@ -5,11 +5,6 @@ module.exports = { description: "Check how simp is the user", usage: "(@User)", category: "Fun", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { let simp = Math.floor(Math.random() * 100); if (message.mentions.users.first()) { diff --git a/commands/Fun/sr.js b/commands/Fun/sr.js new file mode 100644 index 0000000..c3ecf50 --- /dev/null +++ b/commands/Fun/sr.js @@ -0,0 +1,15 @@ +const { Client, Message, MessageEmbed } = require("discord.js"); +const supr = require("superscript-text"); +module.exports = { + name: "superscript", + aliases: ["sr"], + description: "Superscript your text", + usage: "(text)", + category: "Fun", + run: async (client, message, args) => { + const text = args.join(" "); + if (!text) return client.err(message, "Fun", "sr", 12); + if (text.includes("@")) return client.err(message, "Fun", "sr", 101); + message.inlineReply(supr(text)); + }, +}; diff --git a/commands/Fun/triggered.js b/commands/Fun/triggered.js new file mode 100644 index 0000000..fa897b9 --- /dev/null +++ b/commands/Fun/triggered.js @@ -0,0 +1,18 @@ +const { Canvas } = require("canvacord"); +const { Client, Message, MessageAttachment } = require("discord.js"); +module.exports = { + name: "trigger", + aliases: ["triggered"], + usage: "{User}", + description: "Have a trigger effect on a user's avatar", + category: "Fun", + run: async (client, message, args) => { + const user = + message.mentions.users.first() || + message.guild.members.cache.get(args[0]) || + message.author; + const ava = user.displayAvatarURL({ format: "png" }); + const imga = await Canvas.trigger(ava); + message.inlineReply(new MessageAttachment(imga, "imgae.gif")); + }, +}; diff --git a/commands/Giveaway/end.js b/commands/Giveaway/end.js index 20cfad1..e3b96e1 100644 --- a/commands/Giveaway/end.js +++ b/commands/Giveaway/end.js @@ -4,11 +4,6 @@ module.exports = { UserPerm: "MANAGE_MESSAGES", usage: "(Message ID)", description: "End a giveaway", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { if (!args[0]) return client.err(message, "Giveaway", "end", 27); const giveaway = client.giveaways.giveaways.find( diff --git a/commands/Giveaway/giveaway.js b/commands/Giveaway/giveaway.js index 437bcb7..dd5b06e 100644 --- a/commands/Giveaway/giveaway.js +++ b/commands/Giveaway/giveaway.js @@ -6,11 +6,6 @@ module.exports = { description: "Start a giveaway", usage: "(Channel) (Time) (Winners(Number)) (Prize)", UserPerm: "MANAGE_MESSAGES", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const channel = message.mentions.channels.first(); if (!channel) return client.err(message, "Giveaway", "giveaway", 28); @@ -33,7 +28,7 @@ module.exports = { inviteToParticipate: "React with 🎉 to enter!", winMessage: `Congratulations {winners}! You won the **${prize}**!`, noWinner: "Could not determine a winner!", - embedFooter: "Made by Ń1ght", + embedFooter: `Made by ${client.author}`, hostedBy: "Hosted by: {user}", winners: "Winner(s)", messageURL: "", diff --git a/commands/Giveaway/reroll.js b/commands/Giveaway/reroll.js index 013a223..6e08945 100644 --- a/commands/Giveaway/reroll.js +++ b/commands/Giveaway/reroll.js @@ -5,11 +5,6 @@ module.exports = { usage: "(Message ID)", description: "Reroll a giveaway", UserPerm: "MANAGE_MESSAGES", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { if (!args[0]) return client.err(message, "Giveaway", "reroll", 27); const giveaway = client.giveaways.giveaways.find( diff --git a/commands/Moderation/announce.js b/commands/Moderation/announce.js index 8dc43b5..8bf89bb 100644 --- a/commands/Moderation/announce.js +++ b/commands/Moderation/announce.js @@ -6,11 +6,6 @@ module.exports = { usage: "{Channel} (Message)", description: "Announce a message to a channel.", category: "Moderation", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const channel = message.mentions.channels.first() || message.channel; if (!args[0]) return client.err(message, "Moderation", "announce", 4); diff --git a/commands/Moderation/ban.js b/commands/Moderation/ban.js index 0ffcaf1..2ead401 100644 --- a/commands/Moderation/ban.js +++ b/commands/Moderation/ban.js @@ -6,11 +6,6 @@ module.exports = { UserPerm: "BAN_MEMBERS", usage: "(User) {Reason}", category: "Moderation", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { let target = message.mentions.members.first() || diff --git a/commands/Moderation/clear.js b/commands/Moderation/clear.js index 32e5a60..796658b 100644 --- a/commands/Moderation/clear.js +++ b/commands/Moderation/clear.js @@ -8,11 +8,6 @@ module.exports = { description: "Clear/Purge 1-100 messages in the channel", usage: "(Number)", category: "Moderation", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { if ( !args[0] || diff --git a/commands/Moderation/clearWarns.js b/commands/Moderation/clearWarns.js index ccbf530..8eccd0a 100644 --- a/commands/Moderation/clearWarns.js +++ b/commands/Moderation/clearWarns.js @@ -6,11 +6,6 @@ module.exports = { description: "Clear an user's warns", UserPerm: "MANAGE_MESSAGES", category: "Moderation", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const user = message.mentions.members.first() || diff --git a/commands/Moderation/kick.js b/commands/Moderation/kick.js index 7947257..7554fa7 100644 --- a/commands/Moderation/kick.js +++ b/commands/Moderation/kick.js @@ -6,11 +6,6 @@ module.exports = { BotPem: "KICK_MEMBERS", usage: "(User) {Reason}", category: "Moderation", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { let target = message.mentions.members.first() || diff --git a/commands/Moderation/lock.js b/commands/Moderation/lock.js index 6529673..06d286c 100644 --- a/commands/Moderation/lock.js +++ b/commands/Moderation/lock.js @@ -7,11 +7,6 @@ module.exports = { UserPerm: "MANAGE_CHANNELS", BotPerm: "MANAGE_CHANNELS", category: "Moderation", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { message.channel .createOverwrite(message.guild.id, { SEND_MESSAGES: false }) diff --git a/commands/Moderation/mute.js b/commands/Moderation/mute.js index f3b6cb8..7affb20 100644 --- a/commands/Moderation/mute.js +++ b/commands/Moderation/mute.js @@ -7,11 +7,6 @@ module.exports = { UserPerm: "MANAGE_MESSAGES", BotPerm: "MANAGE_ROLES", category: "Moderation", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { let Member = message.mentions.members.first(); const time = args[1]; diff --git a/commands/Moderation/nuke.js b/commands/Moderation/nuke.js index fbdb996..0d1a77f 100644 --- a/commands/Moderation/nuke.js +++ b/commands/Moderation/nuke.js @@ -6,11 +6,6 @@ module.exports = { UserPerm: "MANAGE_CHANNELS", BotPerm: "MANAGE_CHANNELS", category: "Moderation", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { try { let filter = m => m.author.id === message.author.id; diff --git a/commands/Moderation/pin.js b/commands/Moderation/pin.js index 8d847fb..f41438e 100644 --- a/commands/Moderation/pin.js +++ b/commands/Moderation/pin.js @@ -6,11 +6,6 @@ module.exports = { description: "Pin a message in the server", BotPerm: "MANAGE_MESSAGES", UserPerm: "MANAGE_MESSAGES", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { if (!args[0]) return client.err(message, "Moderation", "pin", 27); try { diff --git a/commands/Moderation/removeWarn.js b/commands/Moderation/removeWarn.js index e06f688..6daaf6f 100644 --- a/commands/Moderation/removeWarn.js +++ b/commands/Moderation/removeWarn.js @@ -6,11 +6,6 @@ module.exports = { description: "Remove a latest warn for an user", usage: "(User)", category: "Moderation", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { try { const user = diff --git a/commands/Moderation/role.js b/commands/Moderation/role.js index bcd6ee8..2720183 100644 --- a/commands/Moderation/role.js +++ b/commands/Moderation/role.js @@ -6,11 +6,6 @@ module.exports = { usage: "(Role) (User)", description: "Add/Remove a role for an user", category: "Moderation", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { try { const target = diff --git a/commands/Moderation/slowmode.js b/commands/Moderation/slowmode.js index feb805a..699a4be 100644 --- a/commands/Moderation/slowmode.js +++ b/commands/Moderation/slowmode.js @@ -7,11 +7,6 @@ module.exports = { BotPerm: "MANAGE_CHANNELS", usage: "(Time)", category: "Moderation", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { try { if (!args[0]) { diff --git a/commands/Moderation/unban.js b/commands/Moderation/unban.js index cc6d172..eb19fbc 100644 --- a/commands/Moderation/unban.js +++ b/commands/Moderation/unban.js @@ -6,11 +6,6 @@ module.exports = { BotPerm: "BAN_MEMBERS", usage: "(User)", category: "Moderation", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { try { if (!args[0]) return client.err(message, "Moderation", "unban", 1); diff --git a/commands/Moderation/unlock.js b/commands/Moderation/unlock.js index a95fa56..6888b3c 100644 --- a/commands/Moderation/unlock.js +++ b/commands/Moderation/unlock.js @@ -6,11 +6,6 @@ module.exports = { UserPerm: "MANAGE_CHANNELS", BotPerm: "MANAGE_CHANNELS", category: "Moderation", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { message.channel .createOverwrite(message.guild.id, { SEND_MESSAGES: true }) diff --git a/commands/Moderation/unmute.js b/commands/Moderation/unmute.js index 1f53a00..0dfc9d1 100644 --- a/commands/Moderation/unmute.js +++ b/commands/Moderation/unmute.js @@ -6,11 +6,6 @@ module.exports = { usage: "(User)", description: "Unmute an user", category: "Moderation", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { try { const user = diff --git a/commands/Moderation/warn.js b/commands/Moderation/warn.js index c385ddc..798cf76 100644 --- a/commands/Moderation/warn.js +++ b/commands/Moderation/warn.js @@ -6,11 +6,6 @@ module.exports = { usage: "(User) {Reason}", description: "Warn a user", category: "Moderation", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { try { const user = diff --git a/commands/Moderation/warns.js b/commands/Moderation/warns.js index f423dde..66c8cd3 100644 --- a/commands/Moderation/warns.js +++ b/commands/Moderation/warns.js @@ -6,11 +6,6 @@ module.exports = { description: "Check the warns of an user", usage: "{User}", category: "Moderation", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { try { const user = diff --git a/commands/Music/leave.js b/commands/Music/leave.js index 8715503..848a247 100644 --- a/commands/Music/leave.js +++ b/commands/Music/leave.js @@ -4,16 +4,11 @@ module.exports = { aliases: ["dc"], description: "Leave The Voice Channel", category: "Music", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { let channel = message.member.voice.channel; - if (!channel) return client.err(message, "Music", "disconnect", 35); + if (!channel) return client.err(message, "Music", "leave", 35); if (!message.guild.me.voice.channel) - return client.err(message, "Music", "disconnect", 41); + return client.err(message, "Music", "leave", 41); try { await message.guild.me.voice.channel.leave(); } catch (error) { diff --git a/commands/Music/loop.js b/commands/Music/loop.js index 36cedaf..2c53495 100644 --- a/commands/Music/loop.js +++ b/commands/Music/loop.js @@ -3,11 +3,6 @@ module.exports = { name: "loop", description: "Music loop", category: "Music", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const serverQueue = message.client.queue.get(message.guild.id); if (serverQueue) { diff --git a/commands/Music/lyrics.js b/commands/Music/lyrics.js index 16f315d..c7c8c12 100644 --- a/commands/Music/lyrics.js +++ b/commands/Music/lyrics.js @@ -1,16 +1,11 @@ const { Client, Message, MessageEmbed } = require("discord.js"); const lyricsFinder = require("lyrics-finder"); -const splitlyrics = require("../../util/pagination"); +const splitlyrics = require("../../util/pagination/pagination"); module.exports = { name: "lyrics", description: "Get lyrics for the currently playing song", category: "Music", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const queue = message.client.queue.get(message.guild.id); if (!queue) return client.err(message, "Music", "lyrics", 34); diff --git a/commands/Music/nowplaying.js b/commands/Music/nowplaying.js index e78de68..d5f00c5 100644 --- a/commands/Music/nowplaying.js +++ b/commands/Music/nowplaying.js @@ -3,11 +3,6 @@ module.exports = { name: "nowplaying", description: "To show the music which is currently playing in this server", category: "Music", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const serverQueue = message.client.queue.get(message.guild.id); if (!serverQueue) return client.err(message, "Music", "nowplaying", 34); diff --git a/commands/Music/pause.js b/commands/Music/pause.js index 8e5a64f..6c689cb 100644 --- a/commands/Music/pause.js +++ b/commands/Music/pause.js @@ -3,11 +3,6 @@ module.exports = { name: "pause", description: "To pause the current music in the server", category: "Music", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const serverQueue = message.client.queue.get(message.guild.id); if (serverQueue && serverQueue.playing) { diff --git a/commands/Music/play.js b/commands/Music/play.js index 6a35794..00c89d8 100644 --- a/commands/Music/play.js +++ b/commands/Music/play.js @@ -11,11 +11,6 @@ module.exports = { aliases: ["p"], category: "Music", BotPerm: ["CONNECT", "SPEAK"], - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { let channel = message.member.voice.channel; if (!channel) return client.err(message, "Music", "play", 35); diff --git a/commands/Music/playlist.js b/commands/Music/playlist.js index a356a3a..76b27dd 100644 --- a/commands/Music/playlist.js +++ b/commands/Music/playlist.js @@ -10,11 +10,6 @@ module.exports = { usage: "(YouTube Playlist URL)/(Playlist Name)", category: "Music", BotPerm: ["CONNECT", "SPEAK"], - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const channel = message.member.voice.channel; if (!channel) return client.err(message, "Music", "playlist", 35); diff --git a/commands/Music/queue.js b/commands/Music/queue.js index 68a04c0..4cd2499 100644 --- a/commands/Music/queue.js +++ b/commands/Music/queue.js @@ -1,16 +1,11 @@ const { Client, Message, MessageEmbed } = require("discord.js"); -const util = require("../../util/pagination"); +const util = require("../../util/pagination/pagination"); module.exports = { name: "queue", description: "To show the songs queue", aliases: ["q"], category: "Music", BotPerm: ["MANAGE_MESSAGES", "ADD_REACTIONS"], - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const queue = message.client.queue.get(message.guild.id); if (!queue) return client.err(message, "Music", "queue", 34); diff --git a/commands/Music/remove.js b/commands/Music/remove.js index 6ef452a..400ae09 100644 --- a/commands/Music/remove.js +++ b/commands/Music/remove.js @@ -5,11 +5,6 @@ module.exports = { usage: "(Number)", aliases: ["rm"], category: "Music", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const queue = message.client.queue.get(message.guild.id); if (!queue) return client.err(message, "Music", "remove", 37); @@ -23,7 +18,7 @@ module.exports = { const embed = new MessageEmbed() .setColor(client.color) .setDescription(`❌ **|** Removed: **${song[0].title}** from the queue`) - .setTimestamp("Made by Cath Team"); + .setTimestamp(`Made by ${client.author}`); const song = queue.songs.splice(args[0] - 1, 1); message.inlineReply(embed); message.react("✅"); diff --git a/commands/Music/resume.js b/commands/Music/resume.js index 9f67090..5208686 100644 --- a/commands/Music/resume.js +++ b/commands/Music/resume.js @@ -4,11 +4,7 @@ module.exports = { description: "To resume the paused music", aliases: ["continue"], category: "Music", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ + run: async (client, message, args) => { const serverQueue = message.client.queue.get(message.guild.id); if (serverQueue && !serverQueue.playing) { diff --git a/commands/Music/shuffle.js b/commands/Music/shuffle.js index ce169eb..1035498 100644 --- a/commands/Music/shuffle.js +++ b/commands/Music/shuffle.js @@ -3,11 +3,6 @@ module.exports = { name: "shuffle", description: "Shuffle queue", category: "Music", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const serverQueue = message.client.queue.get(message.guild.id); if (!serverQueue) return client.err(message, "Music", "shuffle", 37); diff --git a/commands/Music/skip.js b/commands/Music/skip.js index 12112b1..c4b09f9 100644 --- a/commands/Music/skip.js +++ b/commands/Music/skip.js @@ -3,11 +3,6 @@ module.exports = { name: "skip", description: "To skip the current music", category: "Music", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const channel = message.member.voice.channel; if (!channel) return client.err(message, "Music", "skip", 35); diff --git a/commands/Music/skipto.js b/commands/Music/skipto.js index 0fd46cf..2cb8da0 100644 --- a/commands/Music/skipto.js +++ b/commands/Music/skipto.js @@ -4,11 +4,6 @@ module.exports = { description: "Skip to the selected queue number", usage: "(Number)", category: "Music", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { if (!args.length || isNaN(args[0])) return client.err(message, "Music", "skipto", 101); diff --git a/commands/Music/stop.js b/commands/Music/stop.js index 91124e4..242c3ca 100644 --- a/commands/Music/stop.js +++ b/commands/Music/stop.js @@ -3,11 +3,6 @@ module.exports = { name: "stop", description: "To stop the music and clear the queue", category: "Music", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const channel = message.member.voice.channel; if (!channel) return client.err(message, "Music", "stop", 35); diff --git a/commands/Music/volume.js b/commands/Music/volume.js index 022c04f..952ff07 100644 --- a/commands/Music/volume.js +++ b/commands/Music/volume.js @@ -5,11 +5,6 @@ module.exports = { usage: "(Number)", aliases: ["vol"], category: "Music", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const channel = message.member.voice.channel; if (!channel) return client.err(message, "Music", "volume", 35); diff --git a/commands/Owner/accept.js b/commands/Owner/accept.js index cac20ea..97a6158 100644 --- a/commands/Owner/accept.js +++ b/commands/Owner/accept.js @@ -5,11 +5,6 @@ module.exports = { usage: "(Message)", description: "Accept a suggestion", Owner: true, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const MessageID = args[0]; const acceptQuery = @@ -21,7 +16,6 @@ module.exports = { client.SuggestionLog ); const suggestEmbed = await suggestionChannel.messages.fetch(MessageID); - console.log(suggestEmbed); const data = suggestEmbed.embeds[0]; const acceptEmbed = new MessageEmbed() .setAuthor(data.author.name, data.author.iconURL) diff --git a/commands/Owner/add.js b/commands/Owner/add.js index f60f64f..6034b07 100644 --- a/commands/Owner/add.js +++ b/commands/Owner/add.js @@ -5,11 +5,6 @@ module.exports = { usage: "(Number)", description: "Add coins from someone", Owner: true, - /** - * @param {Client}client - * @param {Message}message - * @param {String[]} args - */ run: async (client, message, args) => { if (!args[0] || isNaN(args[0])) return message.channel.send("Number of coins?"); diff --git a/commands/Owner/blacklist.js b/commands/Owner/blacklist.js index f7e3129..81b3018 100644 --- a/commands/Owner/blacklist.js +++ b/commands/Owner/blacklist.js @@ -5,11 +5,6 @@ module.exports = { usage: "(User) (Toggle) (Reason)", description: "Blacklist someone from the bot", Owner: true, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { let user = args[0]; toggle = args[1]; diff --git a/commands/Owner/cls.js b/commands/Owner/cls.js new file mode 100644 index 0000000..d25e6ae --- /dev/null +++ b/commands/Owner/cls.js @@ -0,0 +1,10 @@ +const { Client, Message, MessageEmbed } = require("discord.js"); + +module.exports = { + name: "cls", + run: async (client, message, args) => { + message.channel.send( + "**\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n**" + ); + }, +}; diff --git a/commands/Owner/deny.js b/commands/Owner/deny.js index c1eb153..7165a6d 100644 --- a/commands/Owner/deny.js +++ b/commands/Owner/deny.js @@ -5,11 +5,6 @@ module.exports = { usage: "(Message)", description: "Deny a suggestion", Owner: true, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const MessageID = args[0]; const denyQuery = @@ -21,7 +16,6 @@ module.exports = { client.SuggestionLog ); const suggestEmbed = await suggestionChannel.messages.fetch(MessageID); - console.log(suggestEmbed); const data = suggestEmbed.embeds[0]; const denyEmbed = new MessageEmbed() .setAuthor(data.author.name, data.author.iconURL) diff --git a/commands/Owner/dm.js b/commands/Owner/dm.js index df28132..e9f8b41 100644 --- a/commands/Owner/dm.js +++ b/commands/Owner/dm.js @@ -5,11 +5,6 @@ module.exports = { usage: "(User) (Message)", description: "DM a user", Owner: true, - /** - * @param {Client}client - * @param {Message}message - * @param {String[]} args - */ run: async (client, message, args) => { const user = client.users.cache.get(args[0]); if (!user) return message.inlineReply("User?"); diff --git a/commands/Owner/encrypt.js b/commands/Owner/encrypt.js index 3544327..00b09e1 100644 --- a/commands/Owner/encrypt.js +++ b/commands/Owner/encrypt.js @@ -3,11 +3,6 @@ const { Client, Message, MessageEmbed } = require("discord.js"); module.exports = { name: "code", Owner: true, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const encrypted = encrypt(args.slice(0).join(" ")); message.channel.send(`\`\`\`${encrypted}\`\`\``); diff --git a/commands/Owner/eval.js b/commands/Owner/eval.js index 8fb7496..1e0fe46 100644 --- a/commands/Owner/eval.js +++ b/commands/Owner/eval.js @@ -5,11 +5,6 @@ module.exports = { aliases: ["e"], usage: "(Code)", Owner: true, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { let code = args.join(" "); if (!code) return client.err(message, "Owner", "eval", 53); diff --git a/commands/Owner/getinvite.js b/commands/Owner/getinvite.js index 8425cfc..5594f42 100644 --- a/commands/Owner/getinvite.js +++ b/commands/Owner/getinvite.js @@ -5,11 +5,6 @@ module.exports = { usage: "(Guild)", description: "Generates an invitation to the server", Owner: true, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { let guild = null; if (!args[0]) return client.err(message, "Owner", "getinvite", 0); diff --git a/commands/Owner/guilds.js b/commands/Owner/guilds.js index 0a34113..4ab8dee 100644 --- a/commands/Owner/guilds.js +++ b/commands/Owner/guilds.js @@ -4,11 +4,6 @@ module.exports = { category: "Owner", description: "Check top 10 guilds of the bot", Owner: true, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const guilds = client.guilds.cache .sort((a, b) => b.memberCount - a.memberCount) @@ -22,7 +17,7 @@ module.exports = { .setTitle("Guilds") .setDescription(description) .setColor(client.color) - .setFooter(`Made by Cath Team`) + .setFooter(`Made by ${client.author}`) .setTimestamp(); message.channel.send(embed); }, diff --git a/commands/Owner/premium.js b/commands/Owner/premium.js index 6a5cbe2..918d3c3 100644 --- a/commands/Owner/premium.js +++ b/commands/Owner/premium.js @@ -5,11 +5,6 @@ module.exports = { usage: "(User) (Toggle) (Tier)", description: "Set someone into Premium with tiers", Owner: true, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const member = message.mentions.members.first() || diff --git a/commands/Owner/reaction-role.js b/commands/Owner/reaction-role.js index 8249bb1..9cc3cbc 100644 --- a/commands/Owner/reaction-role.js +++ b/commands/Owner/reaction-role.js @@ -1,12 +1,7 @@ const { Client, Message, MessageEmbed } = require("discord.js"); module.exports = { - name: "test", + name: "rr", Owner: true, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const embed = new MessageEmbed() .setAuthor( @@ -40,7 +35,7 @@ module.exports = { }, { name: "YouTube<:YouTube:841186450497339412>", - value: "<@&765928569397575750>", + value: "<@&841026772790673448>", inline: true, } ) diff --git a/commands/Owner/restart.js b/commands/Owner/restart.js index b5a8015..175df47 100644 --- a/commands/Owner/restart.js +++ b/commands/Owner/restart.js @@ -4,16 +4,10 @@ module.exports = { category: "Owner", description: "Restart the bot", Owner: true, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { - message.channel - .send("Restarting...") - .then(message => client.destroy()) - .then(() => client.login(process.env.TOKEN)); - message.channel.send("Restarted"); + const msg = await message.channel.send("Restarting..."); + await client.destroy(); + await client.login(process.env.TOKEN); + await msg.delete().then(msg => message.channel.send("Restarted")); }, }; diff --git a/commands/Owner/rmv.js b/commands/Owner/rmv.js index 1be65e7..b9d446a 100644 --- a/commands/Owner/rmv.js +++ b/commands/Owner/rmv.js @@ -5,11 +5,6 @@ module.exports = { usage: "(Number)", description: "Remove coins from someone", Owner: true, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { if (!args[0] || isNaN(args[0])) return message.channel.send("Number of coins?"); diff --git a/commands/Owner/setBotAvatar.js b/commands/Owner/setBotAvatar.js index 3f5b019..a96ffcf 100644 --- a/commands/Owner/setBotAvatar.js +++ b/commands/Owner/setBotAvatar.js @@ -5,11 +5,6 @@ module.exports = { usage: "(Link)", description: "Set bot avatar from a link", Owner: true, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { if (message.deletable) { message.delete(); diff --git a/commands/Owner/status.js b/commands/Owner/status.js index c207a3e..c307649 100644 --- a/commands/Owner/status.js +++ b/commands/Owner/status.js @@ -5,11 +5,6 @@ module.exports = { description: "Maintenance mode", category: "Owner", Owner: true, - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { if (!args[0]) return message.channel.send("True or False?"); if (args[0].toLowerCase() === "true") { diff --git a/commands/Owner/try.js b/commands/Owner/try.js index aaf4847..29623e4 100644 --- a/commands/Owner/try.js +++ b/commands/Owner/try.js @@ -1,11 +1,6 @@ const { Client, Message, MessageEmbed } = require("discord.js"); module.exports = { name: "auth", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const random = client.function.rndint(100000, 999999); let ed; @@ -23,7 +18,7 @@ module.exports = { .setTitle("One-Time Password") .setDescription(questions[collectCounter++]) .setColor(client.color) - .setFooter(`Made by Cath Team`) + .setFooter(`Made by ${client.author}`) .setTimestamp() ); const channel = appStart.channel; @@ -42,7 +37,7 @@ module.exports = { .setDescription(`Success`) .setTimestamp() .setColor("GREEN") - .setFooter(`Made by Cath Team`) + .setFooter(`Made by ${client.author}`) ); } else { message.author.send( @@ -50,7 +45,7 @@ module.exports = { .setDescription(`Failed\nPlease try again.`) .setTimestamp() .setColor("RED") - .setFooter(`Made by Cath Team`) + .setFooter(`Made by ${client.author}`) ); } }); diff --git a/commands/Utilities/afk.js b/commands/Utilities/afk.js index 9f37d97..f75f9cb 100644 --- a/commands/Utilities/afk.js +++ b/commands/Utilities/afk.js @@ -4,11 +4,6 @@ module.exports = { description: "Tell someone you are AFK.", usage: "{Status}", category: "Utilities", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { let uuser = message.guild.members.cache.get(message.author.id); const content = args.join(" ") || "No status provided."; @@ -19,7 +14,7 @@ module.exports = { `${message.author.username} is set into AFK.\nStatus : ${content}` ) .setTimestamp() - .setFooter(`Made by Cath Team`) + .setFooter(`Made by ${client.author}`) .setColor(client.color) .setAuthor( message.author.tag, diff --git a/commands/Utilities/avatar.js b/commands/Utilities/avatar.js index d43c48a..6aa71e8 100644 --- a/commands/Utilities/avatar.js +++ b/commands/Utilities/avatar.js @@ -5,11 +5,6 @@ module.exports = { aliases: ["av"], usage: "{User}", category: "Utilities", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const member = message.mentions.members.first() || @@ -46,7 +41,7 @@ module.exports = { })})**` ) .setImage(member.user.displayAvatarURL({ dynamic: true, size: 1024 })) - .setFooter("Made by Cath Team") + .setFooter(`Made by ${client.author}`) .setURL(client.web) .setTimestamp(); return message.inlineReply(embed); diff --git a/commands/Utilities/botinfo.js b/commands/Utilities/botinfo.js index c2764eb..7530c30 100644 --- a/commands/Utilities/botinfo.js +++ b/commands/Utilities/botinfo.js @@ -12,11 +12,6 @@ module.exports = { name: "botinfo", description: "Check the info of the bot", category: "Utilities", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const core = os.cpus()[0]; const embed = new MessageEmbed() diff --git a/commands/Utilities/choose.js b/commands/Utilities/choose.js index f7711bc..fd6083b 100644 --- a/commands/Utilities/choose.js +++ b/commands/Utilities/choose.js @@ -5,11 +5,6 @@ module.exports = { description: "Choose random things", usage: "(Choices)", category: "Utilities", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const split = args.join(" ").split(" "); if (!split) return client.err(message, "Utilities", "choose", 0); diff --git a/commands/Utilities/emoji.js b/commands/Utilities/emoji.js index 1b02cfe..dace54e 100644 --- a/commands/Utilities/emoji.js +++ b/commands/Utilities/emoji.js @@ -5,11 +5,6 @@ module.exports = { usage: "(Emoji)", description: "Show an emoji URL", category: "Utilities", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { if (!args.length) return client.err(message, "Utilities", "emoji", 11); for (const rawEmoji of args) { diff --git a/commands/Utilities/emojiadd.js b/commands/Utilities/emojiadd.js index 7e4cd76..913c4b8 100644 --- a/commands/Utilities/emojiadd.js +++ b/commands/Utilities/emojiadd.js @@ -5,13 +5,9 @@ module.exports = { aliases: ["addemoji"], description: "Show an emoji URL or add the emoji to the server", category: "Utilities", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { if (!args.length) return client.err(message, "Utilities", "emojiadd", 0); + if (message.attachments) { message.attachments.map(m => { if ( @@ -23,14 +19,19 @@ module.exports = { ) { try { if (message.attachments.map(u => u.size) > 256000) - return client.err(message, "Utilities", "emojiadd", 19); - + return client.err(message, "Utilities", "emojiadd", 50); if (args[0].length < 2 || args[0].match(/\W/)) return client.err(message, "Utilities", "emojiadd", 49); message.attachments.map(u => { try { - message.guild.emojis.create(u.url, args[0]); - message.inlineReply(`Added :${args[0]}: to the server`); + message.guild.emojis.create(u.url, args[0]).then(msg => { + const em = message.guild.emojis.cache.find( + a => a.name == args[0] + ); + message.inlineReply( + `Added <:${em.name}:${em.id}> to the server` + ); + }); } catch (e) { console.log(e); return client.err(message, "Utilities", "emojiadd", 999); @@ -45,10 +46,12 @@ module.exports = { } if (args[0].includes("https")) { try { - if (args[0].length < 2 || args[0].match(/\W/)) + if (args[1].length < 2 || args[1].match(/\W/)) return client.err(message, "Utilities", "emojiadd", 49); - message.guild.emojis.create(args[0], args[1]); - message.inlineReply(`Added :${args[1]}: to the server`); + message.guild.emojis.create(args[0], args[1]).then(msg => { + const em = message.guild.emojis.cache.find(a => a.name == args[1]); + message.inlineReply(`Added <:${em.name}:${em.id}> to the server`); + }); } catch (e) { console.log(e); return client.err(message, "Utilities", "emojiadd", 999); diff --git a/commands/Utilities/esnipe.js b/commands/Utilities/esnipe.js index 14235e4..b366cb1 100644 --- a/commands/Utilities/esnipe.js +++ b/commands/Utilities/esnipe.js @@ -6,11 +6,6 @@ module.exports = { aliases: ["esnipe"], usage: "{Channel}", description: "Snipe an edited message", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { let channel = message.mentions.channels.first() || diff --git a/commands/Utilities/help.js b/commands/Utilities/help.js index 3169865..4409916 100644 --- a/commands/Utilities/help.js +++ b/commands/Utilities/help.js @@ -1,8 +1,6 @@ const { MessageEmbed } = require("discord.js"); const { readdirSync } = require("fs"); -const { ca } = require("../../config.json"); const ms = require("ms"); -require("../../inlinereply"); module.exports = { name: "help", @@ -10,21 +8,16 @@ module.exports = { usage: "(Command/Category)", description: "Shows all available bot commands", category: "Utilities", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const p = await client.prefix(message); const emoji = { - CODM: "", - Config: "<:staff:829718501224480788>", + CODM: "", + Config: "<:staff:840231971526803467>", Economy: client.currency, Fun: "", Moderation: ":tools:", Utilities: ":gear:", - Music: "", + Music: "", Giveaway: "", }; if (!args[0]) { @@ -42,9 +35,21 @@ module.exports = { categories.push(data); }); const embed = new MessageEmbed() - .setTitle("**cath.exe commands**") + .setTitle(`**${client.user.username} commands**`) .addFields(categories) - .setDescription(`Links:${ca}`) + + .addField( + "**Invite Link**", + `**Invite me to your server by clicking [here](https://discord.com/api/oauth2/authorize?client_id=${client.user.id}&permissions=4231314550&scope=bot%20applications.commands)**` + ) + .addField( + "**Support Server Invite**", + "**Join the support server by clicking [here](https://discord.gg/SbQHChmGcp)**" + ) + .addField( + "**Premium**", + "**You can either boost support server or gift a nitro to one of the Developer of Cath Team to be premium user**" + ) .setURL(client.web) .setFooter( `Requested by ${message.author.tag}`, @@ -98,7 +103,7 @@ module.exports = { .setURL(client.web) .setColor(client.color) .setTitle( - "**CODM Commands**" + "**CODM Commands**" ) ); } else if (args[0] === "config") { @@ -131,9 +136,7 @@ module.exports = { .setTimestamp() .setURL(client.web) .setColor(client.color) - .setTitle( - "**Economy Commands**" - ) + .setTitle(`${client.currency}**Economy Commands**${client.currency}`) ); } else if (args[0] === "fun") { const commandList = []; @@ -168,7 +171,7 @@ module.exports = { .setURL(client.web) .setColor(client.color) .setTitle( - "**Music Commands**" + "**Music Commands**" ) ); } else if (args[0] === "giveaway") { @@ -200,109 +203,54 @@ module.exports = { `There isn't any command or category named "${args[0]}"` ); } else { - let BotPerm; - let UserPerm; - const UserPermissions = [command.UserPerm ? command.UserPerm : ""]; - const BotPermissions = [command.BotPerm ? command.BotPerm : ""]; - BotPermissions.forEach(perm => { - if (BotPermissions.includes(command.BotPerm)) - BotPerm = `${perm - .replace("CREATE_INSTANT_INVITE", "Create Invite") - .replace("KICK_MEMBERS", "Kick Members") - .replace("BAN_MEMBERS", "Ban Members") - .replace("ADMINISTRATOR", "Administrator") - .replace("MANAGE_CHANNELS", "Manage Channels") - .replace("MANAGE_GUILD", "Manage Guild") - .replace("ADD_REACTIONS", "Add Reactions") - .replace("VIEW_AUDIT_LOG", "View Audit Log") - .replace("PRIORITY_SPEAKER", "Priority Speaker") - .replace("STREAM", "Stream") - .replace("VIEW_CHANNEL", "View Channel") - .replace("SEND_MESSAGES", "Send Messages") - .replace("SEND_TTS_MESSAGES", "Send TTS Messages") - .replace("MANAGE_MESSAGES", "Manage Messages") - .replace("EMBED_LINKS", "Embed Links") - .replace("ATTACH_FILES", "Attach Files") - .replace("READ_MESSAGE_HISTORY", "Read Message History") - .replace("MENTION_EVERYONE", "Mention Everyone") - .replace("USE_EXTERNAL_EMOJIS", "Use External Emojis") - .replace("VIEW_GUILD_INSIGHTS", "View Guild Insights") - .replace("CONNECT", "Connect") - .replace("SPEAK", "Speak") - .replace("MUTE_MEMBERS", "Mute Members") - .replace("DEAFEN_MEMBERS", "Defean Members") - .replace("MOVE_MEMBERS", "Move Members") - .replace("USE_VAD", "Use VAD") - .replace("CHANGE_NICKNAME", "Change Nickname") - .replace("MANAGE_NICKNAMES", "Manage Nicknames") - .replace("MANAGE_ROLES", "Manage Roles") - .replace("MANAGE_WEBHOOKS", "Manage Webhooks") - .replace("MANAGE_EMOJIS", "Manage Emojis")}\n`; - }); - UserPermissions.forEach(perm => { - if (UserPermissions.includes(command.UserPerm)) - UserPerm = `${perm - .replace("CREATE_INSTANT_INVITE", "Create Invite") - .replace("KICK_MEMBERS", "Kick Members") - .replace("BAN_MEMBERS", "Ban Members") - .replace("ADMINISTRATOR", "Administrator") - .replace("MANAGE_CHANNELS", "Manage Channels") - .replace("MANAGE_GUILD", "Manage Guild") - .replace("ADD_REACTIONS", "Add Reactions") - .replace("VIEW_AUDIT_LOG", "View Audit Log") - .replace("PRIORITY_SPEAKER", "Priority Speaker") - .replace("STREAM", "Stream") - .replace("VIEW_CHANNEL", "View Channel") - .replace("SEND_MESSAGES", "Send Messages") - .replace("SEND_TTS_MESSAGES", "Send TTS Messages") - .replace("MANAGE_MESSAGES", "Manage Messages") - .replace("EMBED_LINKS", "Embed Links") - .replace("ATTACH_FILES", "Attach Files") - .replace("READ_MESSAGE_HISTORY", "Read Message History") - .replace("MENTION_EVERYONE", "Mention Everyone") - .replace("USE_EXTERNAL_EMOJIS", "Use External Emojis") - .replace("VIEW_GUILD_INSIGHTS", "View Guild Insights") - .replace("CONNECT", "Connect") - .replace("SPEAK", "Speak") - .replace("MUTE_MEMBERS", "Mute Members") - .replace("DEAFEN_MEMBERS", "Defean Members") - .replace("MOVE_MEMBERS", "Move Members") - .replace("USE_VAD", "Use VAD") - .replace("CHANGE_NICKNAME", "Change Nickname") - .replace("MANAGE_NICKNAMES", "Manage Nicknames") - .replace("MANAGE_ROLES", "Manage Roles") - .replace("MANAGE_WEBHOOKS", "Manage Webhooks") - .replace("MANAGE_EMOJIS", "Manage Emojis")}\n`; - }); + if (command.UserPerm && Array.isArray(command.UserPerm)) { + UserPermissions = command.UserPerm; + } else UserPermissions = [command.UserPerm ? command.UserPerm : ""]; + if (command.BotPerm && Array.isArray(command.BotPerm)) { + BotPermissions = command.BotPerm; + } else BotPermissions = [command.BotPerm ? command.BotPerm : ""]; + const BotPerms = BotPermissions.map(x => + x + .split("_") + .map(y => y[0] + y.substring(1, y.length).toLowerCase()) + .join(" ") + ).join(", "); + const UserPerms = UserPermissions.map(x => + x + .split("_") + .map(y => y[0] + y.substring(1, y.length).toLowerCase()) + .join(" ") + ).join(", "); const embed = new MessageEmbed() .setTitle(`"${command.name}" command details`) .addField( "**Command**:", command.name ? `\`${command.name}\`` : "N/A" - ) - .addField( - "**Aliases**:", - command.aliases ? `\`${command.aliases.join(", ")}\`` : "N/A" - ) - .addField( + ); + if (command.aliases) { + embed.addField("**Aliases**:", `\`${command.aliases.join(", ")}\``); + } + if (command.usage) { + embed.addField( "**Usage**:", - command.usage - ? `\`${p}${command.name} ${command.usage}\`` - : `\`${p}${command.name}\`` - ) - .addField( - "**Description**:", - command.description ? command.description : "N/A" - ) - .addField( - "**Cooldown**:", - command.timeout ? ms(command.timeout, { long: true }) : "N/A" - ) - .addField( - "**Required User Permission**:", - UserPerm ? UserPerm : "N/A" - ) - .addField("**Required Bot Permission**:", BotPerm ? BotPerm : "N/A") + `\`${p}${command.name} ${command.usage}\`` + ); + } else { + embed.addField("**Usage**:", `\`${p}${command.name}\``); + } + if (command.description) { + embed.addField("**Description**:", command.description); + } + if (command.timeout) { + embed.addField("**Cooldown**:", ms(command.timeout, { long: true })); + } + if (command.UserPerm) { + embed.addField("**Required User Permission**:", UserPerms); + } + if (command.BotPerm) { + embed.addField("**Required Bot Permission**:", BotPerms); + } + embed .setFooter( `Requested by ${message.author.tag}`, message.author.displayAvatarURL({ dynamic: true }) diff --git a/commands/Utilities/invite.js b/commands/Utilities/invite.js index ef2e901..36e4383 100644 --- a/commands/Utilities/invite.js +++ b/commands/Utilities/invite.js @@ -2,17 +2,28 @@ const { Client, Message, MessageEmbed } = require("discord.js"); module.exports = { name: "invite", + aliases: ["support", "bot", "server"], description: "Get bot invite link", - aliases: ["bot"], category: "Utilities", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { - message.inlineReply( - `https://discord.com/api/oauth2/authorize?client_id=${client.user.id}&permissions=4231314550&scope=bot%20applications.commands` - ); + var embed = new MessageEmbed() + .setFooter(`Made by ${client.author}`) + .setColor(client.color) + .setTimestamp() + .setAuthor(message.author.tag, message.author.displayAvatarURL) + .setTitle(`Support/Invite`) + .addField( + "**Invite Link**", + `**Invite me to your server by clicking [here](https://discord.com/api/oauth2/authorize?client_id=${client.user.id}&permissions=4231314550&scope=bot%20applications.commands)**` + ) + .addField( + "**Support Server Invite**", + "**Join the support server by clicking [here](https://discord.gg/SbQHChmGcp)**" + ) + .addField( + "**Premium**", + "**You can either boost support server or gift a nitro to one of the Developer of Cath Team to be premium user**" + ); + message.inlineReply(embed); }, }; diff --git a/commands/Utilities/permission.js b/commands/Utilities/permission.js index 202929c..f4ef0f4 100644 --- a/commands/Utilities/permission.js +++ b/commands/Utilities/permission.js @@ -5,11 +5,6 @@ module.exports = { usage: "(User)", description: "Show user's permission in server/channel", category: "Utilities", - /** - * @param {Client}client - * @param {Message}message - * @param {String[]args} - */ run: async (client, message, args) => { const yes = "✔️"; const no = "❌"; diff --git a/commands/Utilities/poll.js b/commands/Utilities/poll.js index 7c218f2..16eb549 100644 --- a/commands/Utilities/poll.js +++ b/commands/Utilities/poll.js @@ -4,11 +4,6 @@ module.exports = { name: "poll", description: "Join a poll for develop of this bot", category: "Utilities", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const questions = [ "Which statistic of gun you want to see?", diff --git a/commands/Utilities/rank.js b/commands/Utilities/rank.js new file mode 100644 index 0000000..d82be31 --- /dev/null +++ b/commands/Utilities/rank.js @@ -0,0 +1,41 @@ +const { MessageAttachment } = require("discord.js"); +const Levels = require("discord-xp"); +const canvacord = require("canvacord"); +module.exports = { + name: "rank", + description: "Shows the current level and rank of the user!", + usage: "{User}", + timeout: 5000, + category: "Utilities", + run: async (client, message, args) => { + if (!message.guild) return; + if (message.author.bot) return; + const target = + message.mentions.users.first() || + message.guild.members.cache.find( + r => r.user.username.toLowerCase() === args[0].toLocaleLowerCase() + ) || + message.guild.members.cache.find( + r => r.displayName.toLowerCase() === args[0].toLocaleLowerCase() + ) || + message.guild.members.cache.get(args[0]) || + message.author; + const user = await Levels.fetch(target.id, message.guild.id, true); + if (!user) return client.err(message, "Utilities", "rank", 10); + const neededXp = Levels.xpFor(parseInt(user.level) + 1); + const Rank = new canvacord.Rank() + .setAvatar(target.displayAvatarURL({ dynamic: false, format: "png" })) + .setCurrentXP(user.xp) + .setRank(parseInt(user.position)) + .setLevel(user.level) + .setRequiredXP(neededXp) + .setStatus(target.presence.status) + .setProgressBar("BLACK", "COLOR") + .setUsername(target.username) + .setDiscriminator(target.discriminator); + Rank.build().then(data => { + const attachment = new MessageAttachment(data, "RankCard.png"); + message.inlineReply(attachment); + }); + }, +}; diff --git a/commands/Utilities/report.js b/commands/Utilities/report.js index c9346ae..e197356 100644 --- a/commands/Utilities/report.js +++ b/commands/Utilities/report.js @@ -5,11 +5,6 @@ module.exports = { name: "report", description: "Report a bug of the bot", category: "Utilities", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const questions = [ "Describe the bug", diff --git a/commands/Utilities/servericon.js b/commands/Utilities/servericon.js index 3106112..578b309 100644 --- a/commands/Utilities/servericon.js +++ b/commands/Utilities/servericon.js @@ -4,11 +4,6 @@ module.exports = { name: "servericon", description: "View the icon of the server", category: "Utilities", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const Embed = new MessageEmbed() .setTitle(`Icon of ${message.guild.name}`) diff --git a/commands/Utilities/serverinfo.js b/commands/Utilities/serverinfo.js index 59409a5..a3dca6d 100644 --- a/commands/Utilities/serverinfo.js +++ b/commands/Utilities/serverinfo.js @@ -35,11 +35,6 @@ module.exports = { name: "serverinfo", description: "Check the info of the server", category: "Utilities", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const roles = message.guild.roles.cache .sort((a, b) => b.position - a.position) diff --git a/commands/Utilities/snipe.js b/commands/Utilities/snipe.js index 3ab20de..1e17254 100644 --- a/commands/Utilities/snipe.js +++ b/commands/Utilities/snipe.js @@ -4,11 +4,6 @@ module.exports = { name: "snipe", description: "Snipes a deleted message.", category: "Utilities", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { var i = 0; var description = ""; @@ -18,14 +13,13 @@ module.exports = { message.author.displayAvatarURL({ dynamic: true }) ) .setColor(client.color) - .setFooter("Made by Cath Team") + .setFooter(`Made by ${client.author}`) .setURL(client.web); client.snipes.reverse().forEach(msg => { if (msg.channel.id != message.channel.id) return; if (i >= 5) return; if (msg.attachment) { if (msg.attachment.length == 1) { - console.log("one"); description = description + `\n\n**Author:** ${msg.author.username}#${ diff --git a/commands/Utilities/suggest.js b/commands/Utilities/suggest.js index f91db9e..6c539ec 100644 --- a/commands/Utilities/suggest.js +++ b/commands/Utilities/suggest.js @@ -3,11 +3,6 @@ module.exports = { name: "suggest", description: "Make a suggestion of the bot", category: "Utilities", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const questions = [ "Describe the suggestion", diff --git a/commands/Utilities/support.js b/commands/Utilities/support.js deleted file mode 100644 index d843906..0000000 --- a/commands/Utilities/support.js +++ /dev/null @@ -1,16 +0,0 @@ -const { Client, Message, MessageEmbed } = require("discord.js"); - -module.exports = { - name: "support", - description: "Get support server invite link", - aliases: ["server"], - category: "Utilities", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ - run: async (client, message, args) => { - message.inlineReply(`https://discord.gg/SbQHChmGcp`); - }, -}; diff --git a/commands/Utilities/timer.js b/commands/Utilities/timer.js index a198555..a61adc8 100644 --- a/commands/Utilities/timer.js +++ b/commands/Utilities/timer.js @@ -5,11 +5,6 @@ module.exports = { description: "Set a timer for yourself", usage: "(Time)", category: "Utilities", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { if (!args[0]) { return client.err(message, "Utilities", "timer", 19); diff --git a/commands/Utilities/userinfo.js b/commands/Utilities/userinfo.js index ef003c3..b478120 100644 --- a/commands/Utilities/userinfo.js +++ b/commands/Utilities/userinfo.js @@ -6,11 +6,6 @@ module.exports = { description: "Check the info of a user", usage: "{User}", category: "Utilities", - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ run: async (client, message, args) => { const member = message.mentions.members.first() || @@ -24,34 +19,34 @@ module.exports = { ) || message.member; const flags = { - DISCORD_EMPLOYEE: "Discord Staff<:staff:829718501224480788>", - DISCORD_PARTNER: "Partnered Server Owner<:partner:829718449436622858>", - BUGHUNTER_LEVEL_1: "Discord Bug Hunter<:bughunter:829718598343196672>", - BUGHUNTER_LEVEL_2: "Discord Bug Hunter<:bughunterlv2:829718545298358313>", - HYPESQUAD_EVENTS: "HypeSquad Events<:HypeSquad:829718113913405440>", - HOUSE_BRAVERY: "HypeSquad Bravery<:bravery:829718178527182869>", - HOUSE_BRILLIANCE: "HypeSquad Brilliance<:brilliance:829718391727456311>", - HOUSE_BALANCE: "HypeSquad Balance<:balance:829718333204856854>", - EARLY_SUPPORTER: "Early Supporter<:earlysupporter:829717947052195880>", + DISCORD_EMPLOYEE: "Discord Staff<:staff:840231971526803467>", + DISCORD_PARTNER: "Partnered Server Owner<:partner:840231939944480829>", + BUGHUNTER_LEVEL_1: "Discord Bug Hunter<:bughunter:840231967600803920>", + BUGHUNTER_LEVEL_2: "Discord Bug Hunter<:bughunterlv2:840231970017771571>", + HYPESQUAD_EVENTS: "HypeSquad Events<:HypeSquad:840231908599922721>", + HOUSE_BRAVERY: "HypeSquad Bravery<:bravery:840231941974655007>", + HOUSE_BRILLIANCE: "HypeSquad Brilliance<:brilliance:840231943764443136>", + HOUSE_BALANCE: "HypeSquad Balance<:balance:840231925876523018>", + EARLY_SUPPORTER: "Early Supporter<:earlysupporter:840231983216984085>", TEAM_USER: "Team User", SYSTEM: "System", - VERIFIED_BOT: "Verified Bot<:VerifiedBot:822497433933709343>", + VERIFIED_BOT: "Verified Bot<:VerifiedBot:840231982054375425>", VERIFIED_DEVELOPER: - "Early Verified Bot Developer<:discord_bot_dev:829717061802131466>", + "Early Verified Bot Developer<:discord_bot_dev:840231906200387666>", }; let status; switch (member.user.presence.status) { case "online": - status = "<:online:829714260199997482>Online"; + status = "<:online:840231921123721237>Online"; break; case "dnd": - status = "<:do_not_disturb:829714335952535632>Do Not Disturb"; + status = "<:do_not_disturb:840231907715448842>Do Not Disturb"; break; case "idle": - status = "<:idle:829714296211505182>Idle"; + status = "<:idle:840231935485149184>Idle"; break; case "offline": - status = "<:offline:829714364511682582>Offline"; + status = "<:offline:840231954897305620>Offline"; break; } let x = Date.now() - member.user.createdAt; diff --git a/config.json b/config.json index 76c7b2b..6e76eee 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "prefix": "C.", - "mongo": "mongodb://127.0.0.1:27017", + "mongo": "mongodb://127.0.0.1:27017/cath", "URL": "https://cath.gq/", "color": "02023a", "soundcloud": "dmDh7QSlmGpzH9qQoH1YExYCGcyYeYYC", diff --git a/events/afk.js b/events/afk.js index 80b9e70..7e90df8 100644 --- a/events/afk.js +++ b/events/afk.js @@ -1,7 +1,6 @@ -const client = require("../index"); +const client = require("../bot"); const moment = require("moment"); -require("../inlinereply"); -client.on("message", async (message) => { +client.on("message", async message => { if (message.author.bot) return; if (!message.guild) return; const dataa = await client.data.getUser(message.author.id); diff --git a/events/emoji.js b/events/emoji.js index 9782d2d..67d14de 100644 --- a/events/emoji.js +++ b/events/emoji.js @@ -1,4 +1,4 @@ -const client = require("../index"); +const client = require("../bot"); client.on("message", async message => { function Check(str) { if ( @@ -12,9 +12,8 @@ client.on("message", async message => { } if (message.content.startsWith(":") && message.content.endsWith(":")) { let EmojiName = message.content.slice(1, -1); - + if (client.path.includes(message.guild.id)) return; if (Check(EmojiName) === true) { - console.log("cmeoji"); const channel = client.channels.cache.get(message.channel.id); try { if (message.author.bot) return; @@ -48,8 +47,8 @@ client.on("message", async message => { avatarURL: message.author.displayAvatarURL({ dynamic: true }), }); message.delete(); - } catch (error) { - console.log(`Error :\n${error}`); + } catch (e) { + console.log(e); } } else return; } else return; diff --git a/events/goodBye.js b/events/goodBye.js index 6cc151e..0c3aeab 100644 --- a/events/goodBye.js +++ b/events/goodBye.js @@ -1,5 +1,5 @@ const { MessageAttachment } = require("discord.js"); -const client = require("../index"); +const client = require("../bot"); const schema = require("../models/guilds"); const canvas = require("discord-canvas"); diff --git a/events/guild.js b/events/guild.js index b03096a..738e9d8 100644 --- a/events/guild.js +++ b/events/guild.js @@ -1,4 +1,4 @@ -const client = require("../index"); +const client = require("../bot"); const { MessageEmbed } = require("discord.js"); const { Welcome } = require("../config.json"); client.on("guildMemberAdd", async member => { diff --git a/events/guildCreate.js b/events/guildCreate.js index 75ad937..31ca216 100644 --- a/events/guildCreate.js +++ b/events/guildCreate.js @@ -1,4 +1,4 @@ -const client = require("../index"); +const client = require("../bot"); const { MessageEmbed } = require("discord.js"); const db = require("../models/guilds"); const config = require("../config.json"); @@ -16,7 +16,8 @@ client.on("guildCreate", guild => { `**>Owner ID**: \n${guild.owner.id}`, ]) .setFooter( - `${client.user.username} Currently in ${client.guilds.cache.size} servers` + `${client.user.username} Currently in ${client.guilds.cache.size} servers`, + client.user.displayAvatarURL() ) .setTimestamp() .setThumbnail(guild.iconURL({ dynamic: true })) diff --git a/events/guildDelete.js b/events/guildDelete.js index 853a7d5..2906089 100644 --- a/events/guildDelete.js +++ b/events/guildDelete.js @@ -1,13 +1,13 @@ -const client = require("../index"); +const client = require("../bot"); const db = require("../models/guilds"); const { prefix } = require("../config.json"); const { MessageEmbed } = require("discord.js"); client.on("guildDelete", async guild => { - client.data.DelGuild(guild.id).then(() => console.log("Deleted Data")); + client.data.DelGuild(guild.id); client.ServerLog.send( new MessageEmbed() - .setTitle("Deleted from server") + .setTitle("Deleted Server") .addField("Server Info", [ `**>Server Name**: \n${guild.name}`, `**>Server ID**: \n${guild.id}`, @@ -18,7 +18,8 @@ client.on("guildDelete", async guild => { `**>Owner ID**: \n${guild.owner.id}`, ]) .setFooter( - `${client.user.username} Currently in ${client.guilds.cache.size} servers` + `${client.user.username} Currently in ${client.guilds.cache.size} servers`, + client.user.displayAvatarURL() ) .setTimestamp() .setThumbnail(guild.iconURL({ dynamic: true })) diff --git a/events/level.js b/events/level.js index fee599d..8dfa72f 100644 --- a/events/level.js +++ b/events/level.js @@ -1,5 +1,5 @@ const Levels = require("discord-xp"); -const client = require("../index"); +const client = require("../bot"); const users = require("../models/users"); Levels.setURL(require("../config.json").mongo); client.on("message", async message => { diff --git a/events/log.js b/events/log.js new file mode 100644 index 0000000..e69de29 diff --git a/events/message.js b/events/message.js index 01ea8d0..fb2a5b7 100644 --- a/events/message.js +++ b/events/message.js @@ -1,4 +1,4 @@ -const client = require("../index"); +const client = require("../bot"); const leven = require("leven"); const { Collection, MessageEmbed } = require("discord.js"); const { prefix } = require("../config.json"); @@ -7,14 +7,10 @@ const ms = require("ms"); const schema = require("../models/custom-commands"); const Timeout = new Collection(); const Timeout2 = new Collection(); +const db = require("../models/status"); client.on("message", async message => { const p = await client.prefix(message); if (message.author.bot) return; - if (!message.content.startsWith(p)) return; - if (!message.guild) return; - if (!message.member) { - message.member = await message.guild.fetchMember(message); - } if (message.content.match(new RegExp(`^<@!?${client.user.id}>( |)$`))) { const _ = new MessageEmbed() .setTitle("cath.exe") @@ -25,29 +21,41 @@ client.on("message", async message => { ) .setThumbnail(client.user.displayAvatarURL()) .setURL(client.web) - .setFooter("Made by Cath Team") + .setFooter(`Made by ${client.author}`) .setTimestamp() .setColor(client.color); - return message.inlineReply(_).then(m => m.delete({ timeout: 10000 })); + return message.inlineReply(_).then(m => m.delete({ timeout: 15000 })); } + if (!message.content.toLowerCase().startsWith(p.toLowerCase())) return; + if (!message.guild) return; + if (!message.member) { + message.member = await message.guild.fetchMember(message); + } + + db.findOne({ Bot: client.user.id }, async (err, data) => { + if (!data) { + new db({ + Bot: client.user.id, + Status: "false", + }); + } else { + if ( + data.Status && + data.Status == "true" && + !client.owners.includes(message.author.id) + ) + return message.inlineReply( + `**${client.user.username}** is currently in maintenance.\nYou can use **cath.exe#9686** or **Cath 2#7414** if it is online\nIf you need help, please contact **Cat drinking a cat#0795** or **Ń1ght#0001**` + ); + } + }); const data = {}; let guildDB = await client.data.getGuild(message.guild.id); if (!guildDB) return; let userDB = await client.data.getUser(message.author.id); if (!userDB) return; - let botDB = await client.data.getBot(client.user.id); - if (!botDB) return; - data.Bot = botDB; data.Guild = guildDB; data.User = userDB; - if ( - botDB && - botDB.Status == "true" && - !client.owners.includes(message.author.id) - ) - return message.inlineReply( - `**${client.user.username}** is currently in maintenance.\nYou can use **cath.exe#9686** or **Cath 2#7414** if it is online\nIf you need help, please contact **Cat drinking a cat#0795** or **Ń1ght#0001**` - ); if (!guildDB) { await client.data.CreateGuild(message.guild.id); } @@ -119,10 +127,10 @@ client.on("message", async message => { ) .setColor(client.color) .setDescription( - `You aren't a premium user. Please join [this](https://discord.gg/SbQHChmGcp) server and know more` + `You aren't a premium user. You can either boost support server or gift a nitro to one of the Developer of Cath Team to be premium user` ) .setTimestamp() - .setFooter(`Made by Cath Team`) + .setFooter(`Made by ${client.author}`) ); } } diff --git a/events/messageUpdate.js b/events/messageUpdate.js index d6c868a..be24541 100644 --- a/events/messageUpdate.js +++ b/events/messageUpdate.js @@ -1,4 +1,4 @@ -const client = require("../index"); +const client = require("../bot"); client.on("messageUpdate", (message, newMessage) => { function getAllTextFromEmbed(embed) { let text = ""; diff --git a/events/messsageDelete.js b/events/messsageDelete.js index 7788616..3ac487f 100644 --- a/events/messsageDelete.js +++ b/events/messsageDelete.js @@ -1,4 +1,4 @@ -const client = require("../index.js"); +const client = require("../bot"); client.on("messageDelete", async message => { let all = []; if (message.attachments) { diff --git a/events/reactionroles.js b/events/reactionroles.js index 0577190..97b2607 100644 --- a/events/reactionroles.js +++ b/events/reactionroles.js @@ -1,4 +1,4 @@ -const client = require("../index"); +const client = require("../bot"); const Schema = require("../models/reaction"); client.on("messageReactionAdd", async (reaction, user) => { diff --git a/events/ready.js b/events/ready.js index 8ce31a7..8a90ab9 100644 --- a/events/ready.js +++ b/events/ready.js @@ -1,4 +1,4 @@ -const client = require("../index"); +const client = require("../bot"); const config = require("../config.json"); const prefix = config.prefix; const version = require("../package.json").version; diff --git a/events/slash.js b/events/slash.js index 17e1788..1533a2e 100644 --- a/events/slash.js +++ b/events/slash.js @@ -1,5 +1,5 @@ const { Client, Message, MessageEmbed } = require("discord.js"); -const client = require("../index"); +const client = require("../bot"); async function createApiMessage(interaction, content) { const apiMessage = await APIMessage.create( client.channels.resolve(interaction.channel_id), @@ -18,7 +18,7 @@ client.on("ready", async () => { }, }); }); -client.ws.on("INTERACTION_CREATE", async (interaction) => { +client.ws.on("INTERACTION_CREATE", async interaction => { let command = interaction.data.name.toLowerCase(); let args = interaction.data.options; if (command === "help") { diff --git a/index.js b/index.js index 2116325..c29ffa6 100644 --- a/index.js +++ b/index.js @@ -1,110 +1,14 @@ -const { - Client, - Collection, - WebhookClient, - MessageEmbed, -} = require("discord.js"); -const { GiveawaysManager } = require("discord-giveaways"); -const fs = require("fs"); -const config = require("./config.json"); -require("dotenv").config(); -const client = new Client({ - disableEveryone: true, - disableMentions: "everyone", - restTimeOffset: 0, - partials: ["MESSAGE", "CHANNEL", "REACTION", "GUILD_MEMBER"], - intents: ["GUILDS", "GUILD_MESSAGES", "GUILD_MEMBERS", "GUILD_PRESENCES"], -}); -module.exports = client; -client.color = config.color; -client.author = "Cath Team"; -client.web = config.URL; -client.DMLog = new WebhookClient(process.env.DMLogID, process.env.DMLogToken); -client.CMDLog = new WebhookClient( - process.env.CMDLogID, - process.env.CMDLogToken -); -client.ReadyLog = new WebhookClient( - process.env.ReadyLogID, - process.env.ReadyLogToken -); -client.ServerLog = new WebhookClient( - process.env.ServerLogID, - process.env.ServerLogToken -); -client.ErrorLog = new WebhookClient( - process.env.ErrorLogID, - process.env.ErrorLogToken -); -process.on("unhandledRejection", async err => { - if (client.user) { - if (client.user.id === client.user.id) { - const embed = new MessageEmbed() - .setTitle("UnhandledRejection Error") - .setDescription(`\`\`\`ini\n${err.stack}\`\`\``) - .setTimestamp() - .setColor(client.color) - .setFooter(client.user.username); - client.ErrorLog.send(embed); - } - } - return console.log(err); -}); -client.SuggestionLog = config.Suggestion; -client.ReportLog = config.Report; -client.commands = new Collection(); -client.aliases = new Collection(); -client.events = new Collection(); -client.snipes = []; -client.esnipes = new Collection(); -client.hide = new Collection(); -client.queue = new Map(); -client.Timers = new Map(); -client.cat = config.ca; -client.function = require("./util/functions/function"); -client.data = require("./util/functions/mongoose"); -client.err = require("./util/err"); -client.data - .connect(config.mongo) - .then(() => console.log("Connected to MongoDB!")) - .catch(e => console.log(e)); -client.owners = [ - "452076196419600394", - "749692825402212494", - "766645910087139338", - "755476040029306952", - "534027706325532694", -]; -client.currency = "<:cp:836630372661329990>"; -client.path = [ - "614423108388126731", - "767173194943168542", - "783633408738721834", - "718762019586572341", - "784052348561522730", - "840225563193114624", - "800396461229080619", -]; -client.xp = [ - "749135655350697986", - "801677847730585620", - "796316316880732160", - "755074176431423609", - "712255334298943569", - "639498286297907230", -]; -client.giveaways = new GiveawaysManager(client, { - storage: "./util/Data/giveaways.json", - updateCountdownEvery: 1000, - default: { - botsCanWin: false, - embedColor: client.color, - reaction: "🎉", - }, -}); -client.categories = fs.readdirSync("./commands/"); -client.paths = fs.readdirSync("./cat/"); -["command"].forEach(handler => { - require(`./util/command-handler`)(client); -}); -client.login(process.env.TOKEN); +const { ShardingManager } = require("discord.js"); +const manger = new ShardingManager(`./bot.js`, { + token: "NzY1NTQyNDI0OTY4ODIyNzg1.X4WU8Q.gEwsAO8uMyJLZ2v7xq_TSRODvfk", + totalShards: `auto`, +}); + +manger.on(`shardCreate`, shard => { + console.log( + `[${new Date().toString().split(" ", 5).join(" ")}] Spawned shard #${ + shard.id + }` + ); +}); +manger.spawn(manger.totalShards, 10000); diff --git a/models/guilds.js b/models/guilds.js index 0e286aa..69a8251 100644 --- a/models/guilds.js +++ b/models/guilds.js @@ -16,10 +16,9 @@ module.exports = mongoose.model( type: String, default: "null", }, - Log: { - type: String, - default: "null", - }, + Log: { type: String, default: "null" }, + LogWebhookID: { type: String, default: "null" }, + LogWebhookToken: { type: String, default: "null" }, Premium: { type: Boolean, default: false, diff --git a/package-lock.json b/package-lock.json index 47d96ab..dd1f1ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -375,6 +375,11 @@ "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==" }, + "aesthetically": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/aesthetically/-/aesthetically-0.0.5.tgz", + "integrity": "sha512-jrMnbCfNbqq/z34J+FZI6sYu/cnYv1QrpWVZUDshdfAGPojZ8OWt8gC+yYR6PJZK46fzL9HOWF9mP6Am9Dr7zQ==" + }, "agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -810,9 +815,9 @@ } }, "canvacord": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/canvacord/-/canvacord-5.2.0.tgz", - "integrity": "sha512-Cr+ZM/N2Dhjbvkhm0Tu0Kg3oCx67J/koBFHoSKIrLzOvsiaiFFPAXIRpaJiTXeRVXk8adZa+g1812dwcjmPq6g==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/canvacord/-/canvacord-5.2.1.tgz", + "integrity": "sha512-vauEvj3QEDNyza6laa4C5cKiOSld/O+Uvjr8uzD+ANUxaWtprHE6372J7oXMqrjPEsOd4XAwKuy5zlVPe4a7OQ==", "requires": { "@canvacord/assets": "^1.0.2", "@canvacord/emoji-parser": "^1.0.1", @@ -820,35 +825,6 @@ "gifencoder": "^2.0.1", "moment": "^2.29.1", "moment-duration-format": "^2.3.2" - }, - "dependencies": { - "canvas": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/canvas/-/canvas-2.7.0.tgz", - "integrity": "sha512-pzCxtkHb+5su5MQjTtepMDlIOtaXo277x0C0u3nMOxtkhTyQ+h2yNKhlROAaDllWgRyePAUitC08sXw26Eb6aw==", - "requires": { - "nan": "^2.14.0", - "node-pre-gyp": "^0.15.0", - "simple-get": "^3.0.3" - } - }, - "node-pre-gyp": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.15.0.tgz", - "integrity": "sha512-7QcZa8/fpaU/BKenjcaeFF9hLz2+7S9AqyXFhlH/rilsQ/hPZKK32RtR5EQHJElgu+q5RfbJ34KriI79UWaorA==", - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.3", - "needle": "^2.5.0", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4.4.2" - } - } } }, "canvas": { @@ -1114,9 +1090,9 @@ } }, "css-what": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-5.0.0.tgz", - "integrity": "sha512-qxyKHQvgKwzwDWC/rGbT821eJalfupxYW2qbSJSAtdSTimsr/MlaGONoNLllaUPZWf8QnbcKM/kPVYUQuEKAFA==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-5.0.1.tgz", + "integrity": "sha512-FYDTSHb/7KXsWICVsxdmiExPjCfRC4qRFBdVwv7Ax9hMnvMmEjP9RfxTEZ3qPZGmADDn2vAKSo9UcN1jKVYscg==" }, "cssom": { "version": "0.4.4", @@ -1170,21 +1146,6 @@ "whatwg-url": "^8.0.0" } }, - "debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "requires": { - "ms": "^2.1.1" - }, - "dependencies": { - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - } - } - }, "decimal.js": { "version": "10.2.1", "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.2.1.tgz", @@ -1861,14 +1822,6 @@ "rimraf": "^2.2.8" } }, - "fs-minipass": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", - "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", - "requires": { - "minipass": "^2.6.0" - } - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2214,14 +2167,6 @@ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" }, - "ignore-walk": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz", - "integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==", - "requires": { - "minimatch": "^3.0.4" - } - }, "imageapi.js": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/imageapi.js/-/imageapi.js-1.7.0.tgz", @@ -2851,31 +2796,6 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, - "minipass": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", - "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", - "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", - "requires": { - "minipass": "^2.9.0" - } - }, - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "requires": { - "minimist": "^1.2.5" - } - }, "mkdirp-classic": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", @@ -2995,16 +2915,6 @@ "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" }, - "needle": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.6.0.tgz", - "integrity": "sha512-KKYdza4heMsEfSWD7VPUIz3zX2XDwOyX2d+geb4vrERZMT5RMU6ujjaD+I5Yr54uZxQ2w6XRTAhHBbSCyovZBg==", - "requires": { - "debug": "^3.2.6", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, "negotiator": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", @@ -3089,38 +2999,6 @@ "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=" }, - "nopt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", - "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz", - "integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==", - "requires": { - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npm-normalize-package-bin": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", - "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==" - }, - "npm-packlist": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz", - "integrity": "sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==", - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1", - "npm-normalize-package-bin": "^1.0.1" - } - }, "npmlog": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", @@ -3209,25 +3087,6 @@ "resolved": "https://registry.npmjs.org/opusscript/-/opusscript-0.0.8.tgz", "integrity": "sha512-VSTi1aWFuCkRCVq+tx/BQ5q9fMnQ9pVZ3JU4UHKqTkf0ED3fKEPdr+gKAAl3IA2hj9rrP6iyq3hlcJq3HELtNQ==" }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" - }, - "osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, "parse-cache-control": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz", @@ -4107,6 +3966,11 @@ "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=" }, + "string-toolkit": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/string-toolkit/-/string-toolkit-1.4.0.tgz", + "integrity": "sha512-PVCMeHy+MiMfBAAp3xk41rPsLsIBFm0KE9DJaJq50Zym9vgRE6v936BwWChQceMREm6eCaQ+QNvw8PC4ft+KvA==" + }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -4138,6 +4002,11 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" }, + "superscript-text": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/superscript-text/-/superscript-text-1.0.0.tgz", + "integrity": "sha1-58snUlZzYN9QvrBhDOjfPXHY39g=" + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -4151,20 +4020,6 @@ "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==" }, - "tar": { - "version": "4.4.13", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", - "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.8.6", - "minizlib": "^1.2.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.3" - } - }, "tar-fs": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", @@ -4279,9 +4134,9 @@ "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" }, "twemoji-parser": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/twemoji-parser/-/twemoji-parser-13.0.0.tgz", - "integrity": "sha512-zMaGdskpH8yKjT2RSE/HwE340R4Fm+fbie4AaqjDa4H/l07YUmAvxkSfNl6awVWNRRQ0zdzLQ8SAJZuY5MgstQ==" + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/twemoji-parser/-/twemoji-parser-13.1.0.tgz", + "integrity": "sha512-AQOzLJpYlpWMy8n+0ATyKKZzWlZBJN+G0C+5lhX7Ftc2PeEVdUU/7ns2Pn2vVje26AIZ/OHwFoUbdv6YYD/wGg==" }, "type": { "version": "1.2.0", @@ -4508,11 +4363,6 @@ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==" }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" - }, "youtube-sr": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/youtube-sr/-/youtube-sr-4.0.6.tgz", diff --git a/package.json b/package.json index fc49663..a4de709 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,9 @@ "dependencies": { "@discordjs/opus": "^0.5.0", "@reconlx/discord.js": "^1.1.101", + "aesthetically": "0.0.5", "axios": "^0.21.1", - "canvacord": "^5.2.0", + "canvacord": "^5.2.1", "canvas": "^2.8.0", "cath": "^1.0.7", "common-tags": "^1.8.0", @@ -73,6 +74,7 @@ "reconlx": "^1.2.41", "soundcloud-downloader": "^0.2.4", "string-toolkit": "^1.4.0", + "superscript-text": "^1.0.0", "weky": "^1.4.2", "yt-search": "^2.8.0", "ytdl-core": "^4.8.0", diff --git a/util/dist/bash.sh b/util/dist/bash.sh new file mode 100644 index 0000000..27480d8 --- /dev/null +++ b/util/dist/bash.sh @@ -0,0 +1,24 @@ +export NVM_DIR=/home/runner/nvm +export NODE_VERSION=14.17 + +if ! ls $NVM_DIR > /dev/null 2>&1 +then mkdir -p $NVM_DIR +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash +fi + +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" +nvm use $NODE_VERSION + +rm -rf node_modules/ +npm i + +if [ $(npm -v) != "6.14.9" ] +then npm i -g npm@6.14.9 +fi + +npm outdated | grep "MISSING" +if [ $? -eq 0 ] +then npm i +fi + +node . \ No newline at end of file diff --git a/util/dist/cmds.js b/util/dist/cmds.js new file mode 100644 index 0000000..4cc4e83 --- /dev/null +++ b/util/dist/cmds.js @@ -0,0 +1,39 @@ +const { readdirSync } = require("fs"); +const ms = require("ms"); +function cmds() { + let categories = []; + + readdirSync("./commands").forEach(dir => { + const dirs = readdirSync(`./commands/${dir}`).filter(file => + file.endsWith(".js") + ); + let commands = []; + dirs.map(cmd => { + const file = require(`../../commands/${dir}/${cmd}`); + commands.push({ + name: file.name ? file.name : "No command name", + description: file.description + ? file.description + : "No command description", + aliases: file.aliases ? file.aliases : "No command aliases", + usage: file.usage ? `C.${file.name} ${file.usage}` : `C.${file.name}`, + timeout: file.timeout + ? ms(file.timeout, { long: true }) + : "No command cooldown", + BotPermission: file.BotPerm + ? file.BotPerm + : "No required bot permission", + UserPermission: file.UserPerm + ? file.UserPerm + : "No required user permission", + }); + }); + let data = { + name: dir, + commands, + }; + categories.push(data); + }); + return categories; +} +module.exports = { cmds }; diff --git a/util/err.js b/util/dist/err.js similarity index 96% rename from util/err.js rename to util/dist/err.js index 6ed95ec..35f88b7 100644 --- a/util/err.js +++ b/util/dist/err.js @@ -1,6 +1,5 @@ const { MessageEmbed } = require("discord.js"); -const client = require("../index"); -require("../inlinereply.js"); +const client = require("../../bot"); /** * @param {String} message * @param {String} dir @@ -191,7 +190,7 @@ module.exports = async (message, dir, file, err) => { "Missing argument"; break; } - const pull = require(`../commands/${dir}/${file}`); + const pull = require(`../../commands/${dir}/${file}`); let pre = await client.prefix(message); let embed = new MessageEmbed() .setAuthor( @@ -200,7 +199,7 @@ module.exports = async (message, dir, file, err) => { ) .setColor("RED") .setDescription( - `${require("../config.json").ca}\nUse \`${pre}help ${ + `${require("../../config.json").ca}\nUse \`${pre}help ${ pull.name }\` to get help\n \n ` ) diff --git a/util/item.js b/util/dist/item.js similarity index 57% rename from util/item.js rename to util/dist/item.js index 1d4a093..78300fe 100644 --- a/util/item.js +++ b/util/dist/item.js @@ -1,66 +1,66 @@ module.exports = [ { - item: "<:na45:829965262739996672> NA-45", + item: "<:na45:840231919529623562> NA-45", alias: "na45", id: "na45", price: 10000, }, { - item: "<:50gs:829965044703559690> Akimbo .50 GS", + item: "<:50gs:840231952045178892> Akimbo .50 GS", alias: ".50gs", id: ".50gs", price: 10000, }, { - item: "<:mantaray:815149866489610281> Manta Ray", + item: "<:mantaray:840231914747985941> Manta Ray", alias: "mantaray", id: "mantaray", price: 50000, }, { - item: "<:zer0:827143771329921034> Zero", + item: "<:zer0:840231945778626642> Zero", alias: "zero", id: "zero", price: 50000, }, { - item: "<:artery:827143979727978496> Artery", + item: "<:artery:840231910575833118> Artery", alias: "artery", id: "artery", price: 50000, }, { - item: "<:alias:827143908084547626> Alias", + item: "<:alias:840231973443338321> Alias", alias: "alias", id: "alias", price: 50000, }, { - item: "<:urban:827143838258692097> Urban Tracker", + item: "<:urban:840231930741653545> Urban Tracker", alias: "urban", id: "urban", price: 50000, }, { - item: "<:scylla:838676436402700331> Scylla", + item: "<:scylla:840231932289089556> Scylla", alias: "scylla", id: "scylla", price: 50000, }, { - item: "<:parkk:838677177024905216> Park", + item: "<:parkk:840231975380975636> Park", alias: "park", id: "park", price: 50000, }, { - item: "<:mara:838676389120442398> Mara", + item: "<:mara:840231965210968104> Mara", alias: "mara", id: "mara", price: 50000, }, { - item: "<:outrider:838676881720475658> Outrider", + item: "<:outrider:840231986504794153> Outrider", alias: "outrider", id: "outrider", price: 50000, diff --git a/util/functions/mongoose.js b/util/functions/mongoose.js index eb55157..cd4bb42 100644 --- a/util/functions/mongoose.js +++ b/util/functions/mongoose.js @@ -119,29 +119,6 @@ module.exports = { }; } }, - /** - * @param {String} ID - Bot ID - */ - async getBot(ID) { - if (!ID) throw new Error("Bot ID?"); - const bot = await m.findOne({ Bot: ID }).lean().cache(120); - if (!bot) { - const ss = new m({ Bot: ID }); - const { Bot, Status } = ss; - await ss.save().catch(error => console.log(error)); - return { - Bot, - Status, - }; - } else { - const Bot = bot.Bot; - const Status = bot.Status; - return { - Bot, - Status, - }; - } - }, /** * @param {String} ID - User ID * @param {String} Reason - AFK Reason @@ -328,17 +305,26 @@ module.exports = { /** * @param {String} ID - Guild ID * @param {String} Channel - Log Channel + * @param {String} WebhookID - WebhookID + * @param {String} WebhookToken - WebhookToken */ - async setLog(ID, Channel) { + async setLog(ID, Channel, WID, WToken) { if (!ID) throw new Error("Guild ID?"); if (!Channel) throw new Error("Channel?"); + if (!WID) throw new Error("WebhookID?"); + if (!WToken) throw new Error("WebhookToken?"); const guild = await g.findOne({ Guild: ID }); if (!guild) { const newU = new g({ Guild: ID }); + newU.LogChannel = Channel; + newU.LogWebhookID = WID; + newU.LogWebhookToken = WToken; await newU.save().catch(error => console.log(error)); return { Channel }; } guild.Log = Channel; + guild.LogWebhookID = WID; + guild.LogWebhookToken = WToken; await guild.save().catch(error => console.log(error)); cachegoose.clearCache(); return { Channel }; diff --git a/util/pagify.js b/util/pagination/pagify.js similarity index 100% rename from util/pagify.js rename to util/pagination/pagify.js diff --git a/util/pagination.js b/util/pagination/pagination.js similarity index 100% rename from util/pagination.js rename to util/pagination/pagination.js