From 8a0217010af75748484e0935c33d1d80e264aaf5 Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Thu, 13 Jan 2022 00:26:23 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B1=D0=BB=D0=B5=D0=BC=20ESLint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/JaBa.js | 60 ++++++++++++------------ base/User.js | 4 +- commands/Administration/addcommand.js | 2 +- commands/Administration/addemoji.js | 2 +- commands/Administration/automod.js | 6 +-- commands/Administration/autorole.js | 4 +- commands/Administration/backup.js | 4 +- commands/Administration/configuration.js | 2 +- commands/Administration/delcommand.js | 2 +- commands/Administration/deletemod.js | 4 +- commands/Administration/goodbye.js | 25 +++++----- commands/Administration/ignore.js | 4 +- commands/Administration/set.js | 4 +- commands/Administration/setbirthdays.js | 4 +- commands/Administration/setlang.js | 2 +- commands/Administration/setmodlogs.js | 4 +- commands/Administration/setprefix.js | 2 +- commands/Administration/setreports.js | 4 +- commands/Administration/setsuggests.js | 4 +- commands/Administration/slowmode.js | 4 +- commands/Administration/welcome.js | 20 ++++---- commands/Economy/achievements.js | 2 +- commands/Economy/birthdate.js | 4 +- commands/Economy/deposit.js | 4 +- commands/Economy/divorce.js | 2 +- commands/Economy/leaderboard.js | 6 +-- commands/Economy/marry.js | 20 ++++---- commands/Economy/money.js | 2 +- commands/Economy/pay.js | 2 +- commands/Economy/profile.js | 4 +- commands/Economy/rep.js | 8 ++-- commands/Economy/rob.js | 6 +-- commands/Economy/setbio.js | 2 +- commands/Economy/slots.js | 22 ++++----- commands/Economy/transactions.js | 12 ++--- commands/Economy/withdraw.js | 4 +- commands/Economy/work.js | 22 ++++----- commands/Fun/8ball.js | 2 +- commands/Fun/ascii.js | 2 +- commands/Fun/choice.js | 2 +- commands/Fun/findwords.js | 28 +++++------ commands/Fun/flip.js | 2 +- commands/Fun/fml.js | 2 +- commands/Fun/joke.js | 2 +- commands/Fun/lmg.js | 2 +- commands/Fun/lovecalc.js | 2 +- commands/Fun/number.js | 17 ++----- commands/Fun/tictactoe.js | 6 +-- commands/General/activity.js | 34 +++++++------- commands/General/github.js | 2 +- commands/General/hastebin.js | 4 +- commands/General/help.js | 10 ++-- commands/General/invitations.js | 6 +-- commands/General/invite.js | 2 +- commands/General/minecraft.js | 6 +-- commands/General/permissions.js | 4 +- commands/General/ping.js | 2 +- commands/General/quote.js | 18 +++---- commands/General/remindme.js | 2 +- commands/General/report.js | 2 +- commands/General/serverinfo.js | 6 +-- commands/General/setafk.js | 6 +-- commands/General/shorturl.js | 2 +- commands/General/someone.js | 2 +- commands/General/staff.js | 2 +- commands/General/stats.js | 2 +- commands/General/suggest.js | 2 +- commands/General/translate.js | 4 +- commands/General/userinfo.js | 26 +++++----- commands/Images/approved.js | 7 ++- commands/Images/avatar.js | 7 ++- commands/Images/batslap.js | 7 ++- commands/Images/beautiful.js | 7 ++- commands/Images/bed.js | 7 ++- commands/Images/brazzers.js | 7 ++- commands/Images/burn.js | 7 ++- commands/Images/captcha.js | 7 ++- commands/Images/challenger.js | 7 ++- commands/Images/clyde.js | 7 ++- commands/Images/dictator.js | 7 ++- commands/Images/facepalm.js | 7 ++- commands/Images/fire.js | 7 ++- commands/Images/jail.js | 7 ++- commands/Images/love.js | 7 ++- commands/Images/mission.js | 7 ++- commands/Images/phcomment.js | 15 +++--- commands/Images/qrcode.js | 3 +- commands/Images/rip.js | 7 ++- commands/Images/scary.js | 7 ++- commands/Images/tobecontinued.js | 7 ++- commands/Images/trash.js | 5 +- commands/Images/triggered.js | 7 ++- commands/Images/tweet.js | 7 ++- commands/Images/wanted.js | 7 ++- commands/Images/wasted.js | 7 ++- commands/Images/youtube-comment.js | 12 ++--- commands/Moderation/announcement.js | 8 ++-- commands/Moderation/ban.js | 8 ++-- commands/Moderation/clear.js | 6 +-- commands/Moderation/clearsanctions.js | 2 +- commands/Moderation/giveaway.js | 4 +- commands/Moderation/kick.js | 4 +- commands/Moderation/mute.js | 2 +- commands/Moderation/poll.js | 8 ++-- commands/Moderation/sanctions.js | 4 +- commands/Moderation/setwarns.js | 8 ++-- commands/Moderation/unban.js | 6 +-- commands/Moderation/unmute.js | 4 +- commands/Moderation/warn.js | 30 ++++++------ commands/Music/autoplay.js | 2 +- commands/Music/back.js | 2 +- commands/Music/clip.js | 4 +- commands/Music/clips.js | 4 +- commands/Music/filter.js | 4 +- commands/Music/filters.js | 2 +- commands/Music/jump.js | 2 +- commands/Music/loop.js | 6 +-- commands/Music/lyrics.js | 4 +- commands/Music/np.js | 2 +- commands/Music/pause.js | 2 +- commands/Music/play.js | 2 +- commands/Music/queue.js | 8 ++-- commands/Music/resume.js | 2 +- commands/Music/seek.js | 2 +- commands/Music/skip.js | 2 +- commands/Music/stop.js | 2 +- commands/NSFW/hentai.js | 36 +++++++------- commands/Owner/debug.js | 10 ++-- commands/Owner/eval.js | 4 +- commands/Owner/reload.js | 2 +- commands/Owner/say.js | 8 ++-- commands/Owner/servers-list.js | 24 +++++----- dashboard/app.js | 2 +- dashboard/auth/CheckAuth.js | 2 +- dashboard/routes/discord.js | 12 ++--- dashboard/routes/docs.js | 3 +- dashboard/routes/guild-manager.js | 20 ++++---- dashboard/routes/guild-stats.js | 24 +++++----- dashboard/routes/profile.js | 6 +-- dashboard/utils.js | 6 +-- events/guildCreate.js | 14 +++--- events/guildMemberAdd.js | 10 ++-- events/guildMemberRemove.js | 8 ++-- events/guildMemberUpdate.js | 2 +- events/messageCreate.js | 40 ++++++++-------- events/ready.js | 3 +- helpers/autoUpdateDocs.js | 2 +- helpers/birthdays.js | 12 ++--- helpers/checkReminds.js | 6 +-- helpers/checkUnmutes.js | 2 +- helpers/discordbots.org.js | 2 +- helpers/functions.js | 36 +++++++------- helpers/languages.js | 6 +-- helpers/logger.js | 42 ++++++++--------- helpers/resolvers.js | 18 +++---- index.js | 8 ++-- scripts/create-db-indexes.js | 2 +- scripts/migrate-db-from-v4.6-to-v4.7.js | 2 +- scripts/verify-config.js | 24 +++++----- 159 files changed, 592 insertions(+), 648 deletions(-) diff --git a/base/JaBa.js b/base/JaBa.js index 2d54539d..8d84239b 100644 --- a/base/JaBa.js +++ b/base/JaBa.js @@ -63,7 +63,7 @@ class JaBa extends Client { this.player .on("playSong", async (queue, song) => { - const m = await queue.textChannel.send({ content: this.translate("music/play:NOW_PLAYING", { songName: song.name }) }) + const m = await queue.textChannel.send({ content: this.translate("music/play:NOW_PLAYING", { songName: song.name }) }); if (!song.isLive) { setTimeout(() => { if (m.deletable) m.delete(); @@ -77,7 +77,7 @@ class JaBa extends Client { .on("addSong", (queue, song) => queue.textChannel.send({ content: this.translate("music/play:ADDED_QUEUE", { songName: song.name }) })) .on("addList", (queue, playlist) => queue.textChannel.send({ content: this.translate("music/play:ADDED_QUEUE_COUNT", { songCount: playlist.songs.length }) })) .on("searchResult", (message, result) => { - let i = 0 + let i = 0; const embed = new MessageEmbed() .setDescription(Util.escapeSpoiler(result.map(song => `**${++i} -** ${song.name}`).join("\n"))) .setFooter({ text: this.translate("music/play:RESULTS_FOOTER") }) @@ -105,11 +105,11 @@ class JaBa extends Client { reaction: "🎉" } }); - }; + } get defaultLanguage() { return this.languages.find(language => language.default).name; - }; + } translate(key, args, locale) { if (!locale) locale = this.defaultLanguage; @@ -117,7 +117,7 @@ class JaBa extends Client { if (!language) throw "Invalid language set in data."; return language(key, args); - }; + } printDate(date, format, locale) { if (!locale) locale = this.defaultLanguage; @@ -127,7 +127,7 @@ class JaBa extends Client { return moment(new Date(date)) .locale(languageData.moment) .format(format); - }; + } convertTime(time, type, noPrefix, locale) { if (!type) time = "to"; @@ -136,7 +136,7 @@ class JaBa extends Client { const m = moment(time).locale(languageData.moment); return (type === "to" ? m.toNow(noPrefix) : m.fromNow(noPrefix)); - }; + } getNoun(number, one, two, five) { let n = Math.abs(number); @@ -147,7 +147,7 @@ class JaBa extends Client { if (n >= 2 && n <= 4) return two; return five; - }; + } // This function is used to load a command and add it to the collection loadCommand(commandPath, commandName) { @@ -165,8 +165,8 @@ class JaBa extends Client { return false; } catch (e) { return `Unable to load command ${commandName}: ${e}`; - }; - }; + } + } // This function is used to unload a command (you need to load them again) async unloadCommand(commandPath, commandName) { @@ -180,7 +180,7 @@ class JaBa extends Client { delete require.cache[require.resolve(`.${commandPath}${path.sep}${commandName}.js`)]; return false; - }; + } // This function is used to find a user data or create it async findOrCreateUser({ id: userID }, isLean) { @@ -203,9 +203,9 @@ class JaBa extends Client { this.databaseCache.users.set(userID, userData); return isLean ? userData.toJSON() : userData; - }; - }; - }; + } + } + } // This function is used to find a member data or create it async findOrCreateMember({ id: memberID, guildID }, isLean) { @@ -234,13 +234,13 @@ class JaBa extends Client { if (guild) { guild.members.push(memberData._id); await guild.save(); - }; + } this.databaseCache.members.set(`${memberID}${guildID}`, memberData); return isLean ? memberData.toJSON() : memberData; - }; - }; - }; + } + } + } // This function is used to find a guild data or create it async findOrCreateGuild({ id: guildID }, isLean) { @@ -263,9 +263,9 @@ class JaBa extends Client { this.databaseCache.guilds.set(guildID, guildData); return isLean ? guildData.toJSON() : guildData; - }; - }; - }; + } + } + } // This function is used to resolve a user from a string async resolveUser(search) { @@ -277,7 +277,7 @@ class JaBa extends Client { const id = search.match(/^<@!?(\d+)>$/)[1]; user = this.users.fetch(id).catch(() => {}); if (user) return user; - }; + } // Try username search if (search.match(/^!?(\w+)#(\d+)$/)) { @@ -285,11 +285,11 @@ class JaBa extends Client { const discriminator = search.match(/^!?(\w+)#(\d+)$/)[1]; user = this.users.find((u) => u.username === username && u.discriminator === discriminator); if (user) return user; - }; + } user = await this.users.fetch(search).catch(() => {}); return user; - }; + } async resolveMember(search, guild) { let member = null; @@ -300,18 +300,18 @@ class JaBa extends Client { const id = search.match(/^<@!?(\d+)>$/)[1]; member = await guild.members.fetch(id).catch(() => {}); if (member) return member; - }; + } // Try username search if (search.match(/^!?(\w+)#(\d+)$/)) { guild = await guild.fetch(); member = guild.members.cache.find((m) => m.user.tag === search); if (member) return member; - }; + } member = await guild.members.fetch(search).catch(() => {}); return member; - }; + } async resolveRole(search, guild) { let role = null; @@ -322,7 +322,7 @@ class JaBa extends Client { const id = search.match(/^<@&!?(\d+)>$/)[1]; role = guild.roles.cache.get(id); if (role) return role; - }; + } // Try name search role = guild.roles.cache.find((r) => search === r.name); @@ -330,7 +330,7 @@ class JaBa extends Client { role = guild.roles.cache.get(search); return role; - }; -}; + } +} module.exports = JaBa; \ No newline at end of file diff --git a/base/User.js b/base/User.js index dae7be95..35120348 100644 --- a/base/User.js +++ b/base/User.js @@ -6,7 +6,7 @@ const genToken = () => { const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwzy0123456789.-_"; for (let i = 0; i < 32; i++) { token += characters.charAt(Math.floor(Math.random() * characters.length)); - }; + } return token; }; @@ -112,7 +112,7 @@ userSchema.method("getAchievements", async function() { for (let i = 0; i < images.length; i++) { await ctx.drawImage(images[i], dim, 10, 350, 200); dim += 200; - }; + } return canvas.toBuffer(); }); diff --git a/commands/Administration/addcommand.js b/commands/Administration/addcommand.js index 1bbb4058..682aab9a 100644 --- a/commands/Administration/addcommand.js +++ b/commands/Administration/addcommand.js @@ -37,6 +37,6 @@ class Addcommand extends Command { prefix: data.guild.prefix }); } -}; +} module.exports = Addcommand; \ No newline at end of file diff --git a/commands/Administration/addemoji.js b/commands/Administration/addemoji.js index 7a3de8bd..1e92c0a8 100644 --- a/commands/Administration/addemoji.js +++ b/commands/Administration/addemoji.js @@ -33,6 +33,6 @@ class Addemoji extends Command { emojiName: name })); } -}; +} module.exports = Addemoji; \ No newline at end of file diff --git a/commands/Administration/automod.js b/commands/Administration/automod.js index 80accefe..38ea0114 100644 --- a/commands/Administration/automod.js +++ b/commands/Administration/automod.js @@ -47,9 +47,9 @@ class Automod extends Command { data.guild.markModified("plugins.automod"); data.guild.save(); message.success("administration/automod:DISABLED"); - }; - }; + } + } } -}; +} module.exports = Automod; \ No newline at end of file diff --git a/commands/Administration/autorole.js b/commands/Administration/autorole.js index dbfee8b8..53b2ef19 100644 --- a/commands/Administration/autorole.js +++ b/commands/Administration/autorole.js @@ -53,8 +53,8 @@ class Autorole extends Command { message.success("administration/autorole:SUCCESS_DISABLED", { prefix: data.guild.prefix }); - }; + } } -}; +} module.exports = Autorole; \ No newline at end of file diff --git a/commands/Administration/backup.js b/commands/Administration/backup.js index e0f0e9ed..ed27c3b2 100644 --- a/commands/Administration/backup.js +++ b/commands/Administration/backup.js @@ -121,8 +121,8 @@ class Backup extends Command { }); } else { return message.error("administration/backup:MISSING_STATUS"); - }; + } } -}; +} module.exports = Backup; \ No newline at end of file diff --git a/commands/Administration/configuration.js b/commands/Administration/configuration.js index 594e0be4..98209cf9 100644 --- a/commands/Administration/configuration.js +++ b/commands/Administration/configuration.js @@ -91,6 +91,6 @@ class Configuration extends Command { embeds: [embed] }); } -}; +} module.exports = Configuration; \ No newline at end of file diff --git a/commands/Administration/delcommand.js b/commands/Administration/delcommand.js index 4df87e00..04f8cae9 100644 --- a/commands/Administration/delcommand.js +++ b/commands/Administration/delcommand.js @@ -28,6 +28,6 @@ class Delcommand extends Command { commandName: name }); } -}; +} module.exports = Delcommand; \ No newline at end of file diff --git a/commands/Administration/deletemod.js b/commands/Administration/deletemod.js index 7c9b4a6c..cbf1262a 100644 --- a/commands/Administration/deletemod.js +++ b/commands/Administration/deletemod.js @@ -28,8 +28,8 @@ class Deletemod extends Command { data.guild.autoDeleteModCommands = false; data.guild.save(); message.success("administration/deletemod:DISABLED"); - }; + } } -}; +} module.exports = Deletemod; \ No newline at end of file diff --git a/commands/Administration/goodbye.js b/commands/Administration/goodbye.js index 4dea22c7..e054e346 100644 --- a/commands/Administration/goodbye.js +++ b/commands/Administration/goodbye.js @@ -21,7 +21,7 @@ class Goodbye extends Command { if (args[0] === "test" && data.guild.plugins.goodbye.enabled) { this.client.emit("guildMemberRemove", message.member); return message.success("administration/goodbye:TEST_SUCCESS"); - }; + } if ((!args[0] || !["edit", "off"].includes(args[0])) && data.guild.plugins.goodbye.enabled) return message.error("administration/goodbye:MISSING_STATUS"); @@ -58,13 +58,10 @@ class Goodbye extends Command { collector.on("collect", async msg => { // If the message is filled, it means the user sent yes or no for the image if (goodbye.message) { - if (msg.content.toLowerCase() === message.translate("common:YES").toLowerCase()) { - goodbye.withImage = true; - } else if (msg.content.toLowerCase() === message.translate("common:NO").toLowerCase()) { - goodbye.withImage = false; - } else { - return message.error("misc:INVALID_YES_NO"); - }; + if (msg.content.toLowerCase() === message.translate("common:YES").toLowerCase()) goodbye.withImage = true; + else if (msg.content.toLowerCase() === message.translate("common:NO").toLowerCase()) goodbye.withImage = false; + else return message.error("misc:INVALID_YES_NO"); + data.guild.plugins.goodbye = goodbye; data.guild.markModified("plugins.goodbye"); await data.guild.save(); @@ -73,16 +70,16 @@ class Goodbye extends Command { channel: `<#${goodbye.channel}>` }); return collector.stop(); - }; + } // If the channel is filled and the message is not, it means the user sent the message if (goodbye.channel && !goodbye.message) { if (msg.content.length < 1800) { goodbye.message = msg.content; return message.sendT("administration/goodbye:FORM_3"); - }; + } return message.error("administration/goodbye:MAX_CHARACT"); - }; + } // If the channel is not filled, it means the user sent it if (!goodbye.channel) { @@ -98,14 +95,14 @@ class Goodbye extends Command { author: msg.author.tag, memberCount: msg.guild.memberCount }); - }; + } }); collector.on("end", (_, reason) => { if (reason === "time") return message.error("misc:TIMES_UP"); }); - }; + } } -}; +} module.exports = Goodbye; \ No newline at end of file diff --git a/commands/Administration/ignore.js b/commands/Administration/ignore.js index 0e50afa8..a66b4ba2 100644 --- a/commands/Administration/ignore.js +++ b/commands/Administration/ignore.js @@ -34,8 +34,8 @@ class Ignore extends Command { return message.success("administration/ignore:IGNORED", { channel: channel.toString() }); - }; + } } -}; +} module.exports = Ignore; \ No newline at end of file diff --git a/commands/Administration/set.js b/commands/Administration/set.js index 040f1407..52e3458a 100644 --- a/commands/Administration/set.js +++ b/commands/Administration/set.js @@ -16,7 +16,7 @@ class Set extends Command { }); } - async run(message, args, data) { + async run(message, args) { const status = args[0]; if (!status || !["level", "xp", "credits", "bank"].includes(status)) return message.error("administration/set:NO_STATUS"); @@ -52,6 +52,6 @@ class Set extends Command { amount }); } -}; +} module.exports = Set; \ No newline at end of file diff --git a/commands/Administration/setbirthdays.js b/commands/Administration/setbirthdays.js index d55fefe3..17dd45bd 100644 --- a/commands/Administration/setbirthdays.js +++ b/commands/Administration/setbirthdays.js @@ -38,8 +38,8 @@ class Setbirthdays extends Command { return message.success("administration/setbirthdays:ENABLED", { channel: channel.toString() }); - }; + } } -}; +} module.exports = Setbirthdays; \ No newline at end of file diff --git a/commands/Administration/setlang.js b/commands/Administration/setlang.js index ce214036..6fdb8178 100644 --- a/commands/Administration/setlang.js +++ b/commands/Administration/setlang.js @@ -28,6 +28,6 @@ class Setlang extends Command { lang: language.nativeName }); } -}; +} module.exports = Setlang; \ No newline at end of file diff --git a/commands/Administration/setmodlogs.js b/commands/Administration/setmodlogs.js index 6e49723f..f97090c1 100644 --- a/commands/Administration/setmodlogs.js +++ b/commands/Administration/setmodlogs.js @@ -38,8 +38,8 @@ class Setmodlogs extends Command { return message.success("administration/setmodlogs:ENABLED", { channel: channel.toString() }); - }; + } } -}; +} module.exports = Setmodlogs; \ No newline at end of file diff --git a/commands/Administration/setprefix.js b/commands/Administration/setprefix.js index bc84f298..21e89eed 100644 --- a/commands/Administration/setprefix.js +++ b/commands/Administration/setprefix.js @@ -28,6 +28,6 @@ class Setprefix extends Command { prefix }); } -}; +} module.exports = Setprefix; \ No newline at end of file diff --git a/commands/Administration/setreports.js b/commands/Administration/setreports.js index 11855035..7734355a 100644 --- a/commands/Administration/setreports.js +++ b/commands/Administration/setreports.js @@ -38,8 +38,8 @@ class Setreports extends Command { return message.success("administration/setreports:ENABLED", { channel: channel.toString() }); - }; + } } -}; +} module.exports = Setreports; \ No newline at end of file diff --git a/commands/Administration/setsuggests.js b/commands/Administration/setsuggests.js index 5e50b2ce..b0b2c92d 100644 --- a/commands/Administration/setsuggests.js +++ b/commands/Administration/setsuggests.js @@ -38,8 +38,8 @@ class Setsuggests extends Command { return message.success("administration/setsuggests:ENABLED", { channel: channel.toString() }); - }; + } } -}; +} module.exports = Setsuggests; \ No newline at end of file diff --git a/commands/Administration/slowmode.js b/commands/Administration/slowmode.js index 989f0865..aad1f8a1 100644 --- a/commands/Administration/slowmode.js +++ b/commands/Administration/slowmode.js @@ -47,8 +47,8 @@ class Slowmode extends Command { channel: `#${channel.name}`, time: this.client.functions.convertTime(message.guild, ms(time)) }); - }; + } } -}; +} module.exports = Slowmode; \ No newline at end of file diff --git a/commands/Administration/welcome.js b/commands/Administration/welcome.js index a1fae0d5..837d02c3 100644 --- a/commands/Administration/welcome.js +++ b/commands/Administration/welcome.js @@ -21,7 +21,7 @@ class Welcome extends Command { if (args[0] === "test" && data.guild.plugins.welcome.enabled) { this.client.emit("guildMemberAdd", message.member); return message.success("administration/welcome:TEST_SUCCESS"); - }; + } if ((!args[0] || !["edit", "off"].includes(args[0])) && data.guild.plugins.welcome.enabled) return message.error("administration/welcome:MISSING_STATUS"); @@ -64,7 +64,7 @@ class Welcome extends Command { welcome.withImage = false; } else { return message.error("misc:INVALID_YES_NO"); - }; + } data.guild.plugins.welcome = welcome; data.guild.markModified("plugins.welcome"); await data.guild.save(); @@ -73,16 +73,16 @@ class Welcome extends Command { channel: `<#${welcome.channel}>` }); return collector.stop(); - }; + } // If the channel is filled and the message is not, it means the user sent the message if (welcome.channel && !welcome.message) { if (msg.content.length < 1800) { welcome.message = msg.content; return message.sendT("administration/welcome:FORM_3"); - }; + } return message.error("administration/goodbye:MAX_CHARACT"); - }; + } // If the channel is not filled, it means the user sent it if (!welcome.channel) { @@ -98,16 +98,14 @@ class Welcome extends Command { author: msg.author.tag, memberCount: msg.guild.memberCount }); - }; + } }); collector.on("end", (_, reason) => { - if (reason === "time") { - return message.error("misc:TIMES_UP"); - }; + if (reason === "time") return message.error("misc:TIMES_UP"); }); - }; + } } -}; +} module.exports = Welcome; \ No newline at end of file diff --git a/commands/Economy/achievements.js b/commands/Economy/achievements.js index eff6967e..a3256f4c 100644 --- a/commands/Economy/achievements.js +++ b/commands/Economy/achievements.js @@ -75,6 +75,6 @@ class Achievements extends Command { embeds: [embed] }); } -}; +} module.exports = Achievements; \ No newline at end of file diff --git a/commands/Economy/birthdate.js b/commands/Economy/birthdate.js index b28d1c84..eb97d2ef 100644 --- a/commands/Economy/birthdate.js +++ b/commands/Economy/birthdate.js @@ -30,7 +30,7 @@ class Birthdate extends Command { const tday = +match[0], tmonth = +match[1] - 1; let tyear = +match[2]; - + if (tyear < 100) tyear += tyear < 50 ? 2000 : 1900; const d = new Date(tyear, tmonth, tday); @@ -45,6 +45,6 @@ class Birthdate extends Command { date: message.printDate(d) }); } -}; +} module.exports = Birthdate; \ No newline at end of file diff --git a/commands/Economy/deposit.js b/commands/Economy/deposit.js index 485cff9e..04899e97 100644 --- a/commands/Economy/deposit.js +++ b/commands/Economy/deposit.js @@ -26,7 +26,7 @@ class Deposit extends Command { } else { if (isNaN(amount) || parseInt(amount, 10) < 1) return message.error("economy/deposit:MISSING_AMOUNT"); amount = parseInt(amount, 10); - }; + } if (data.memberData.money < amount) return message.error("economy/deposit:NOT_ENOUGH_CREDIT", { money: `**${amount}** ${message.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}` }); @@ -47,6 +47,6 @@ class Deposit extends Command { money: `**${amount}** ${message.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}` }); } -}; +} module.exports = Deposit; \ No newline at end of file diff --git a/commands/Economy/divorce.js b/commands/Economy/divorce.js index 9b81b4be..37e57c3c 100644 --- a/commands/Economy/divorce.js +++ b/commands/Economy/divorce.js @@ -39,6 +39,6 @@ class Divorce extends Command { }) }); } -}; +} module.exports = Divorce; \ No newline at end of file diff --git a/commands/Economy/leaderboard.js b/commands/Economy/leaderboard.js index 90f42786..87ed7ba7 100644 --- a/commands/Economy/leaderboard.js +++ b/commands/Economy/leaderboard.js @@ -83,11 +83,11 @@ class Leaderboard extends Command { message.channel.send({ content: "```\n" + newTable.toString() + "```" }); - }; + } if (isOnlyOnMobile) message.sendT("economy/leaderboard:MOBILE"); } -}; +} module.exports = Leaderboard; @@ -105,4 +105,4 @@ async function fetchUsers(array, table, client) { }); resolve(table); }); -}; \ No newline at end of file +} \ No newline at end of file diff --git a/commands/Economy/marry.js b/commands/Economy/marry.js index 34e85e7d..2029f25e 100644 --- a/commands/Economy/marry.js +++ b/commands/Economy/marry.js @@ -58,8 +58,8 @@ class Marry extends Command { firstUsername: member.user.tag, secondUsername: user.tag }); - }; - }; + } + } // Update pending requests pendings[message.author.id] = member.id; @@ -82,17 +82,13 @@ class Marry extends Command { return collector.stop(false); } else { return message.error("misc:INVALID_YES_NO"); - }; + } }); collector.on("end", async (_collected, reason) => { // Delete pending request delete pendings[message.author.id]; - if (reason === "time") { - return message.error("economy/marry:TIMEOUT", { - username: member.user.toString() - }); - }; + if (reason === "time") return message.error("economy/marry:TIMEOUT", { username: member.user.toString() }); if (reason) { data.userData.lover = member.id; await data.userData.save(); @@ -113,14 +109,14 @@ class Marry extends Command { userData.achievements.married.progress.now = 1; userData.markModified("achievements.married"); userData.save(); - }; + } if (!data.userData.achievements.married.achieved) { if (!sent) message.channel.send(messageOptions); data.userData.achievements.married.achieved = true; data.userData.achievements.married.progress.now = 1; data.userData.markModified("achievements.married"); data.userData.save(); - }; + } return message.success("economy/marry:SUCCESS", { creator: message.author.toString(), partner: member.user.toString() @@ -130,9 +126,9 @@ class Marry extends Command { creator: message.author.toString(), partner: member.user.toString() }); - }; + } }); } -}; +} module.exports = Marry; \ No newline at end of file diff --git a/commands/Economy/money.js b/commands/Economy/money.js index 61615e6d..35777b3e 100644 --- a/commands/Economy/money.js +++ b/commands/Economy/money.js @@ -70,6 +70,6 @@ class Money extends Command { embeds: [embed] }); } -}; +} module.exports = Money; \ No newline at end of file diff --git a/commands/Economy/pay.js b/commands/Economy/pay.js index c3f83453..8beea6e0 100644 --- a/commands/Economy/pay.js +++ b/commands/Economy/pay.js @@ -54,6 +54,6 @@ class Pay extends Command { username: member.user.tag }); } -}; +} module.exports = Pay; \ No newline at end of file diff --git a/commands/Economy/profile.js b/commands/Economy/profile.js index 79100297..14c996d1 100644 --- a/commands/Economy/profile.js +++ b/commands/Economy/profile.js @@ -26,7 +26,7 @@ class Profile extends Command { } async run(message, args, data) { - const arg = args[0] || message.author + const arg = args[0] || message.author; let member = await this.client.resolveMember(arg, message.guild); if (!member) member = message.member; if (member.user.bot) return message.error("economy/profile:BOT_USER"); @@ -92,6 +92,6 @@ class Profile extends Command { }] }); // Send the embed in the current channel } -}; +} module.exports = Profile; \ No newline at end of file diff --git a/commands/Economy/rep.js b/commands/Economy/rep.js index d56ab96b..25370782 100644 --- a/commands/Economy/rep.js +++ b/commands/Economy/rep.js @@ -28,7 +28,7 @@ class Rep extends Command { if (isInCooldown > Date.now()) return message.error("economy/rep:COOLDOWN", { time: message.convertTime(isInCooldown, "to", true) }); - }; + } const user = await this.client.resolveUser(args[0]); if (!user) return message.error("economy/rep:INVALID_USER"); @@ -56,15 +56,15 @@ class Rep extends Command { attachment: "./assets/img/achievements/achievement_unlocked6.png" }] }); - }; + } userData.markModified("achievements.rep"); - }; + } await userData.save(); message.success("economy/rep:SUCCESS", { username: user.username }); } -}; +} module.exports = Rep; \ No newline at end of file diff --git a/commands/Economy/rob.js b/commands/Economy/rob.js index 6a4b4017..de6746d4 100644 --- a/commands/Economy/rob.js +++ b/commands/Economy/rob.js @@ -28,7 +28,7 @@ class Rob extends Command { const isInCooldown = memberData.cooldowns.rob || 0; if (isInCooldown) { if (isInCooldown > Date.now()) return message.error("economy/rob:COOLDOWN", { username: member.user.tag }); - }; + } let amountToRob = args[1]; if (!amountToRob || isNaN(amountToRob) || parseInt(amountToRob, 10) <= 0) return message.error("economy/rob:MISSING_AMOUNT", { username: member.user.username }); @@ -71,8 +71,8 @@ class Rob extends Command { memberData.money += won; memberData.save(); data.memberData.save(); - }; + } } -}; +} module.exports = Rob; \ No newline at end of file diff --git a/commands/Economy/setbio.js b/commands/Economy/setbio.js index 38056596..7c54f76d 100644 --- a/commands/Economy/setbio.js +++ b/commands/Economy/setbio.js @@ -25,6 +25,6 @@ class Setbio extends Command { message.success("economy/setbio:SUCCESS"); await data.userData.save(); } -}; +} module.exports = Setbio; \ No newline at end of file diff --git a/commands/Economy/slots.js b/commands/Economy/slots.js index c9890197..56b3629c 100644 --- a/commands/Economy/slots.js +++ b/commands/Economy/slots.js @@ -42,7 +42,7 @@ class Slots extends Command { else if (isJackpot) number = number * 4; return Math.round(number); - }; + } const tmsg = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" @@ -105,13 +105,13 @@ class Slots extends Command { attachment: "./assets/img/achievements/achievement_unlocked4.png" }] }); - }; + } data.userData.markModified("achievements.slots"); await data.userData.save(); - }; + } await data.memberData.save(); return; - }; + } if (colonnes[0][i2] == colonnes[1][j2] || colonnes[1][j2] == colonnes[2][k2] || colonnes[0][i2] == colonnes[2][k2]) { msg += "| : : : **" + (message.translate("common:VICTORY").toUpperCase()) + "** : : : |"; @@ -146,13 +146,13 @@ class Slots extends Command { attachment: "./assets/img/achievements/achievement_unlocked4.png" }] }); - }; + } data.userData.markModified("achievements.slots"); await data.userData.save(); - }; + } await data.memberData.save(); return; - }; + } msg += "| : : : **" + (message.translate("common:DEFEAT").toUpperCase()) + "** : : : |"; message.channel.send({ @@ -176,10 +176,10 @@ class Slots extends Command { data.userData.achievements.slots.progress.now = 0; data.userData.markModified("achievements.slots"); await data.userData.save(); - }; + } await data.memberData.save(); return; - }; + } function editMsg() { let msg = "[ :slot_machine: | **СЛОТЫ** ]\n------------------\n"; @@ -199,8 +199,8 @@ class Slots extends Command { msg += colonnes[0][i3] + " : " + colonnes[1][j3] + " : " + colonnes[2][k3] + "\n"; tmsg.edit(msg); - }; + } } -}; +} module.exports = Slots; \ No newline at end of file diff --git a/commands/Economy/transactions.js b/commands/Economy/transactions.js index 438d0cc4..e546744a 100644 --- a/commands/Economy/transactions.js +++ b/commands/Economy/transactions.js @@ -24,8 +24,8 @@ class Transactions extends Command { if (t.date > timestamp) { const index = transactions.indexOf(t); transactions.splice(index, 1); - }; - }; + } + } const embed = new Discord.MessageEmbed() .setAuthor({ @@ -54,13 +54,13 @@ class Transactions extends Command { embeds: [embed] }); } else { - embed.addField(message.translate("economy/transactions:T_GOT"), sortedTransactions[0].join("\n"), true) - embed.addField(message.translate("economy/transactions:T_SEND"), sortedTransactions[1].join("\n"), true) - }; + embed.addField(message.translate("economy/transactions:T_GOT"), sortedTransactions[0].join("\n"), true); + embed.addField(message.translate("economy/transactions:T_SEND"), sortedTransactions[1].join("\n"), true); + } message.channel.send({ embeds: [embed] }); } -}; +} module.exports = Transactions; \ No newline at end of file diff --git a/commands/Economy/withdraw.js b/commands/Economy/withdraw.js index c1d4b84c..c8140d04 100644 --- a/commands/Economy/withdraw.js +++ b/commands/Economy/withdraw.js @@ -26,7 +26,7 @@ class Withdraw extends Command { } else { if (isNaN(amount) || parseInt(amount, 10) < 1) return message.error("economy/withdraw:MISSING_AMOUNT"); amount = parseInt(amount, 10); - }; + } if (data.memberData.bankSold < amount) return message.error("economy/withdraw:NOT_ENOUGH", { money: `**${amount}** ${message.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}` }); @@ -47,6 +47,6 @@ class Withdraw extends Command { money: `**${amount}** ${message.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}` }); } -}; +} module.exports = Withdraw; \ No newline at end of file diff --git a/commands/Economy/work.js b/commands/Economy/work.js index 86e5b2fd..6669401d 100644 --- a/commands/Economy/work.js +++ b/commands/Economy/work.js @@ -27,7 +27,7 @@ class Work extends Command { if (isInCooldown > Date.now()) return message.error("economy/work:COOLDOWN", { time: message.convertTime(isInCooldown, "to", true) }); - }; + } if (Date.now() > data.memberData.cooldowns.work + (24 * 3600000)) data.memberData.workStreak = 0; @@ -62,8 +62,8 @@ class Work extends Command { if (data.memberData.workStreak >= 5) { won += 200; embed.addField(message.translate("economy/work:SALARY"), message.translate("economy/work:SALARY_CONTENT", { - won: `${won} ${message.getNoun(won, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}` - })) + won: `${won} ${message.getNoun(won, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}` + })) .addField(message.translate("economy/work:STREAK"), message.translate("economy/work:STREAK_CONTENT")); data.memberData.workStreak = 0; } else { @@ -71,13 +71,13 @@ class Work extends Command { if (data.memberData.workStreak > i) { const letter = Discord.Util.parseEmoji(award[i]).name.split("_")[1]; award[i] = `:regional_indicator_${letter.toLowerCase()}:`; - }; - }; + } + } embed.addField(message.translate("economy/work:SALARY"), message.translate("economy/work:SALARY_CONTENT", { - won: `**${won}** ${message.getNoun(won, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}` - })) + won: `**${won}** ${message.getNoun(won, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}` + })) .addField(message.translate("economy/work:STREAK"), award.join("")); - }; + } const info = { user: message.translate("economy/work:SALARY"), @@ -101,14 +101,14 @@ class Work extends Command { attachment: "./assets/img/achievements/achievement_unlocked1.png" }]; data.userData.achievements.work.achieved = true; - }; + } data.userData.markModified("achievements.work"); data.userData.save(); - }; + } // Send the embed in the current channel message.channel.send(messageOptions); } -}; +} module.exports = Work; \ No newline at end of file diff --git a/commands/Fun/8ball.js b/commands/Fun/8ball.js index e5d69b37..5e4e0eea 100644 --- a/commands/Fun/8ball.js +++ b/commands/Fun/8ball.js @@ -26,6 +26,6 @@ class Eightball extends Command { content: answer }); } -}; +} module.exports = Eightball; \ No newline at end of file diff --git a/commands/Fun/ascii.js b/commands/Fun/ascii.js index 232e260f..ca64835f 100644 --- a/commands/Fun/ascii.js +++ b/commands/Fun/ascii.js @@ -29,6 +29,6 @@ class Ascii extends Command { content: "```" + rendered + "```" }); } -}; +} module.exports = Ascii; \ No newline at end of file diff --git a/commands/Fun/choice.js b/commands/Fun/choice.js index 7b61180f..5d6d255f 100644 --- a/commands/Fun/choice.js +++ b/commands/Fun/choice.js @@ -31,6 +31,6 @@ class Choice extends Command { }); }, 1500); } -}; +} module.exports = Choice; \ No newline at end of file diff --git a/commands/Fun/findwords.js b/commands/Fun/findwords.js index 821c07aa..79637df4 100644 --- a/commands/Fun/findwords.js +++ b/commands/Fun/findwords.js @@ -41,7 +41,7 @@ class FindWords extends Command { for (let i = 0; i < nbGames; i++) { const result = Math.floor((Math.random() * wordList.length)); words.push(wordList[result].substring(0, 3).toLowerCase()); - }; + } let i = 0; // Inits i variable to count games currentGames[message.guild.id] = true; // Update current game variable @@ -77,18 +77,14 @@ class FindWords extends Command { }); collector.on("end", async (collected, reason) => { - if (reason === "time") { - message.error("fun/findwords:NO_WINNER"); - } else if (reason === "force") { - return message.error("misc:FORCE_STOP", { - user: message.author.toString() - }); - } else { + if (reason === "time") message.error("fun/findwords:NO_WINNER"); + else if (reason === "force") return message.error("misc:FORCE_STOP", { user: message.author.toString() }); + else { message.success("fun/findwords:WORD_FOUND", { winner: `<@${reason}>` }); winners.push(reason); - }; + } if (i < nbGames - 1) { i++; @@ -130,11 +126,11 @@ class FindWords extends Command { userdata.money = userdata.money + won; userdata.save(); - }; - }; + } + } }); }, delay); - }; + } async function getWinner(array) { return new Promise(function (resolve) { @@ -150,12 +146,12 @@ class FindWords extends Command { if (counts[winner] > compare) { compare = counts[winner]; mostFrequent = array[i]; - }; - }; + } + } resolve(mostFrequent); }); - }; + } } -}; +} module.exports = FindWords; \ No newline at end of file diff --git a/commands/Fun/flip.js b/commands/Fun/flip.js index f2323922..ab2ecc3d 100644 --- a/commands/Fun/flip.js +++ b/commands/Fun/flip.js @@ -20,6 +20,6 @@ class Flip extends Command { const isHeads = Math.random() > 0.5; isHeads ? message.sendT("fun/flip:HEADS") : message.sendT("fun/flip:TAILS"); } -}; +} module.exports = Flip; \ No newline at end of file diff --git a/commands/Fun/fml.js b/commands/Fun/fml.js index b02b92f9..4b1deed1 100644 --- a/commands/Fun/fml.js +++ b/commands/Fun/fml.js @@ -34,6 +34,6 @@ class Fml extends Command { embeds: [embed] }); } -}; +} module.exports = Fml; \ No newline at end of file diff --git a/commands/Fun/joke.js b/commands/Fun/joke.js index 56ac5b0e..41327b3d 100644 --- a/commands/Fun/joke.js +++ b/commands/Fun/joke.js @@ -34,6 +34,6 @@ class Joke extends Command { embeds: [embed] }); } -}; +} module.exports = Joke; \ No newline at end of file diff --git a/commands/Fun/lmg.js b/commands/Fun/lmg.js index 167f5942..ab9701ff 100644 --- a/commands/Fun/lmg.js +++ b/commands/Fun/lmg.js @@ -25,6 +25,6 @@ class Lmg extends Command { }); message.delete().catch(() => {}); } -}; +} module.exports = Lmg; \ No newline at end of file diff --git a/commands/Fun/lovecalc.js b/commands/Fun/lovecalc.js index e01f738a..b65b4155 100644 --- a/commands/Fun/lovecalc.js +++ b/commands/Fun/lovecalc.js @@ -54,6 +54,6 @@ class Lovecalc extends Command { embeds: [embed] }); } -}; +} module.exports = Lovecalc; \ No newline at end of file diff --git a/commands/Fun/number.js b/commands/Fun/number.js index 71e28a53..6d93ec86 100644 --- a/commands/Fun/number.js +++ b/commands/Fun/number.js @@ -79,27 +79,20 @@ class Number extends Command { userdata.money = userdata.money + won; userdata.save(); - }; + } collector.stop(); - }; + } if (parseInt(msg.content) < number) message.error("fun/number:BIG", { user: msg.author.toString(), number: parsedNumber }); if (parseInt(msg.content) > number) message.error("fun/number:SMALL", { user: msg.author.toString(), number: parsedNumber }); }); collector.on("end", (_collected, reason) => { delete currentGames[message.guild.id]; - if (reason === "time") { - return message.error("fun/number:DEFEAT", { - number - }); - } else if (reason === "force") { - return message.error("misc:FORCE_STOP", { - user: message.author.toString() - }); - }; + if (reason === "time") return message.error("fun/number:DEFEAT", { number }); + else if (reason === "force") return message.error("misc:FORCE_STOP", { user: message.author.toString() }); }); } -}; +} module.exports = Number; \ No newline at end of file diff --git a/commands/Fun/tictactoe.js b/commands/Fun/tictactoe.js index f244faaf..d6c741a0 100644 --- a/commands/Fun/tictactoe.js +++ b/commands/Fun/tictactoe.js @@ -17,8 +17,8 @@ class TicTacToe extends Command { }); } - async run(message, args) { - const game = new TTT({ language: "ru" }) + async run(message) { + const game = new TTT({ language: "ru" }); game.handleMessage(message); game.on("win", async (data) => { @@ -46,6 +46,6 @@ class TicTacToe extends Command { userdata.save(); }); } -}; +} module.exports = TicTacToe; \ No newline at end of file diff --git a/commands/General/activity.js b/commands/General/activity.js index 94e48854..cca1b6c1 100644 --- a/commands/General/activity.js +++ b/commands/General/activity.js @@ -37,7 +37,7 @@ class Activity extends Command { .setFooter({ text: message.translate("general/activity:FOOTER") }) - .setTimestamp() + .setTimestamp(); return message.channel.send({ embeds: [embed] }); @@ -53,7 +53,7 @@ class Activity extends Command { .setFooter({ text: message.translate("general/activity:FOOTER") }) - .setTimestamp() + .setTimestamp(); return message.channel.send({ embeds: [embed] }); @@ -69,7 +69,7 @@ class Activity extends Command { .setFooter({ text: message.translate("general/activity:FOOTER") }) - .setTimestamp() + .setTimestamp(); return message.channel.send({ embeds: [embed] }); @@ -85,7 +85,7 @@ class Activity extends Command { .setFooter({ text: message.translate("general/activity:FOOTER") }) - .setTimestamp() + .setTimestamp(); return message.channel.send({ embeds: [embed] }); @@ -101,7 +101,7 @@ class Activity extends Command { .setFooter({ text: message.translate("general/activity:FOOTER") }) - .setTimestamp() + .setTimestamp(); return message.channel.send({ embeds: [embed] }); @@ -117,7 +117,7 @@ class Activity extends Command { .setFooter({ text: message.translate("general/activity:FOOTER") }) - .setTimestamp() + .setTimestamp(); return message.channel.send({ embeds: [embed] }); @@ -133,7 +133,7 @@ class Activity extends Command { .setFooter({ text: message.translate("general/activity:FOOTER") }) - .setTimestamp() + .setTimestamp(); return message.channel.send({ embeds: [embed] }); @@ -149,7 +149,7 @@ class Activity extends Command { .setFooter({ text: message.translate("general/activity:FOOTER") }) - .setTimestamp() + .setTimestamp(); return message.channel.send({ embeds: [embed] }); @@ -165,7 +165,7 @@ class Activity extends Command { .setFooter({ text: message.translate("general/activity:FOOTER") }) - .setTimestamp() + .setTimestamp(); return message.channel.send({ embeds: [embed] }); @@ -181,7 +181,7 @@ class Activity extends Command { .setFooter({ text: message.translate("general/activity:FOOTER") }) - .setTimestamp() + .setTimestamp(); return message.channel.send({ embeds: [embed] }); @@ -197,7 +197,7 @@ class Activity extends Command { .setFooter({ text: message.translate("general/activity:FOOTER") }) - .setTimestamp() + .setTimestamp(); return message.channel.send({ embeds: [embed] }); @@ -213,14 +213,14 @@ class Activity extends Command { .setFooter({ text: message.translate("general/activity:FOOTER") }) - .setTimestamp() + .setTimestamp(); return message.channel.send({ embeds: [embed] }); }); break; - default: + default: { const embed = new Discord.MessageEmbed() .setTitle(message.translate("general/activity:TITLE")) .setDescription(activities.join("\n")) @@ -228,13 +228,13 @@ class Activity extends Command { .setFooter({ text: message.translate("general/activity:FOOTER") }) - .setTimestamp() + .setTimestamp(); message.channel.send({ embeds: [embed] }); - break; - }; + } + } } -}; +} module.exports = Activity; \ No newline at end of file diff --git a/commands/General/github.js b/commands/General/github.js index 425fd0c7..88dfbabe 100644 --- a/commands/General/github.js +++ b/commands/General/github.js @@ -47,6 +47,6 @@ class Github extends Command { embeds: [embed] }); } -}; +} module.exports = Github; \ No newline at end of file diff --git a/commands/General/hastebin.js b/commands/General/hastebin.js index a6f8518d..d6727adc 100644 --- a/commands/General/hastebin.js +++ b/commands/General/hastebin.js @@ -47,8 +47,8 @@ class Hastebin extends Command { }); } catch (e) { message.error("misc:ERR_OCCURRED"); - }; + } } -}; +} module.exports = Hastebin; \ No newline at end of file diff --git a/commands/General/help.js b/commands/General/help.js index 81a5f0d6..7c475c3d 100644 --- a/commands/General/help.js +++ b/commands/General/help.js @@ -30,7 +30,7 @@ class Help extends Command { return message.error("general/help:NOT_FOUND", { search: args[0] }); - }; + } const description = message.translate(`${cmd.help.category.toLowerCase()}/${cmd.help.name}:DESCRIPTION`); const usage = message.translate(`${cmd.help.category.toLowerCase()}/${cmd.help.name}:USAGE`, { @@ -59,7 +59,7 @@ class Help extends Command { return message.channel.send({ embeds: [groupEmbed] }); - }; + } const categories = []; const commands = this.client.commands; @@ -68,7 +68,7 @@ class Help extends Command { if (!categories.includes(command.help.category)) { if (command.help.category === "Owner" && message.author.id !== this.client.config.owner.id) return; categories.push(command.help.category); - }; + } }); const emojis = this.client.customEmojis; @@ -88,7 +88,7 @@ class Help extends Command { if (message.guild) { if (data.guild.customCommands.length > 0) embed.addField(`${emojis.categories.custom} ${message.guild.name} | ${message.translate("general/help:CUSTOM_COMMANDS")} - (${data.guild.customCommands.length})`, data.guild.customCommands.map((cmd) => `\`${cmd.name}\``).join(", ")); - }; + } embed.addField("\u200B", message.translate("misc:STATS_FOOTER", { dashboardLink: "https://jaba.pp.ua/", @@ -111,6 +111,6 @@ class Help extends Command { embeds: [embed] }); } -}; +} module.exports = Help; \ No newline at end of file diff --git a/commands/General/invitations.js b/commands/General/invitations.js index f29ed0f2..d773fbc7 100644 --- a/commands/General/invitations.js +++ b/commands/General/invitations.js @@ -33,8 +33,8 @@ class Invitations extends Command { return message.error("general/invitations:NOBODY_MEMBER", { member: member.user.tag }); - }; - }; + } + } const content = memberInvites.map((i) => { return message.translate("general/invitations:CODE", { @@ -67,6 +67,6 @@ class Invitations extends Command { embeds: [embed] }); } -}; +} module.exports = Invitations; \ No newline at end of file diff --git a/commands/General/invite.js b/commands/General/invite.js index 14608be4..8972535c 100644 --- a/commands/General/invite.js +++ b/commands/General/invite.js @@ -48,6 +48,6 @@ class Invite extends Command { embeds: [embed] }); } -}; +} module.exports = Invite; \ No newline at end of file diff --git a/commands/General/minecraft.js b/commands/General/minecraft.js index 17134ea4..ba4b5050 100644 --- a/commands/General/minecraft.js +++ b/commands/General/minecraft.js @@ -37,7 +37,7 @@ class Minecraft extends Command { host: ip[0], port: ip[1] }; - }; + } const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" @@ -58,7 +58,7 @@ class Minecraft extends Command { }).catch((err) => { Sentry.captureException(err); }); - }; + } if (!json) return m.error("general/minecraft:FAILED", null, { edit: true }); @@ -92,6 +92,6 @@ class Minecraft extends Command { files: [imgAttachment] }); } -}; +} module.exports = Minecraft; \ No newline at end of file diff --git a/commands/General/permissions.js b/commands/General/permissions.js index c79a6773..87f77ab6 100644 --- a/commands/General/permissions.js +++ b/commands/General/permissions.js @@ -34,13 +34,13 @@ class Permissions extends Command { } else { text += `${perm} ✅\n`; total.allowed++; - }; + } }); text += `\n${total.allowed} ✅ | ${total.denied} ❌` + "\n```"; message.channel.send({ content: text }); } -}; +} module.exports = Permissions; \ No newline at end of file diff --git a/commands/General/ping.js b/commands/General/ping.js index b605fa24..a4978094 100644 --- a/commands/General/ping.js +++ b/commands/General/ping.js @@ -25,6 +25,6 @@ class Ping extends Command { }, { edit: true }); }); } -}; +} module.exports = Ping; \ No newline at end of file diff --git a/commands/General/quote.js b/commands/General/quote.js index 4478c560..8a34e78f 100644 --- a/commands/General/quote.js +++ b/commands/General/quote.js @@ -36,7 +36,7 @@ class Quote extends Command { .setTimestamp(m.createdTimestamp); if (m.attachments.size > 0) embed.setImage(m.attachments.first().url); return embed; - }; + } const msgID = args[0]; if (isNaN(msgID)) { @@ -48,7 +48,7 @@ class Quote extends Command { message.error("misc:CANNOT_DM"); }); return; - }; + } let channel = args[1]; if (args[1]) { @@ -57,18 +57,18 @@ class Quote extends Command { message.author.send(message.translate("general/quote:NO_MESSAGE_ID")).then(() => { message.delete(); }).catch(() => { - message.error("misc:CANNOT_DM") + message.error("misc:CANNOT_DM"); }); return; - }; - }; + } + } if (!channel) { message.channel.messages.fetch(msgID).catch(() => { message.author.send((message.translate("general/quote:NO_MESSAGE_ID"))).then(() => { message.delete(); }).catch(() => { - message.error("misc:CANNOT_DM") + message.error("misc:CANNOT_DM"); }); return; }).then((msg) => { @@ -82,7 +82,7 @@ class Quote extends Command { message.author.send(message.translate("general/quote:NO_MESSAGE_ID")).then(() => { message.delete(); }).catch(() => { - message.error("misc:CANNOT_DM") + message.error("misc:CANNOT_DM"); }); return; }).then((msg) => { @@ -91,8 +91,8 @@ class Quote extends Command { embeds: [embed(msg)] }); }); - }; + } } -}; +} module.exports = Quote; \ No newline at end of file diff --git a/commands/General/remindme.js b/commands/General/remindme.js index aa991c6d..e30b8bdf 100644 --- a/commands/General/remindme.js +++ b/commands/General/remindme.js @@ -40,6 +40,6 @@ class Remindme extends Command { message.success("general/remindme:SAVED"); } -}; +} module.exports = Remindme; \ No newline at end of file diff --git a/commands/General/report.js b/commands/General/report.js index 4efda327..0aa5d0d8 100644 --- a/commands/General/report.js +++ b/commands/General/report.js @@ -64,6 +64,6 @@ class Report extends Command { channel: repChannel.toString() }); } -}; +} module.exports = Report; \ No newline at end of file diff --git a/commands/General/serverinfo.js b/commands/General/serverinfo.js index 0de83325..37e4d382 100644 --- a/commands/General/serverinfo.js +++ b/commands/General/serverinfo.js @@ -25,8 +25,8 @@ class Serverinfo extends Command { if (!found) { found = this.client.guilds.cache.find(g => g.name.includes(args.join(" ")) || g.id === args[0]); if (found) guild = found; - }; - }; + } + } await guild.members.fetch(); const owner = await guild.fetchOwner(); @@ -65,6 +65,6 @@ class Serverinfo extends Command { embeds: [embed] }); } -}; +} module.exports = Serverinfo; \ No newline at end of file diff --git a/commands/General/setafk.js b/commands/General/setafk.js index 7b074b5f..885c0020 100644 --- a/commands/General/setafk.js +++ b/commands/General/setafk.js @@ -28,7 +28,7 @@ class Setafk extends Command { return message.sendT("general/setafk:DELETED", { username: message.author.username }); - }; + } } else { data.userData.afk = reason; data.userData.save(); @@ -42,8 +42,8 @@ class Setafk extends Command { if (m.deletable) m.delete(); if (message.deletable) message.delete(); }, 10 * 1000); - }; + } } -}; +} module.exports = Setafk; \ No newline at end of file diff --git a/commands/General/shorturl.js b/commands/General/shorturl.js index c6016d8c..6f813f4c 100644 --- a/commands/General/shorturl.js +++ b/commands/General/shorturl.js @@ -37,6 +37,6 @@ class ShortURL extends Command { embeds: [embed] }); } -}; +} module.exports = ShortURL; \ No newline at end of file diff --git a/commands/General/someone.js b/commands/General/someone.js index d35cfc50..8ebb847b 100644 --- a/commands/General/someone.js +++ b/commands/General/someone.js @@ -34,6 +34,6 @@ class Someone extends Command { embeds: [embed] }); } -}; +} module.exports = Someone; \ No newline at end of file diff --git a/commands/General/staff.js b/commands/General/staff.js index d41c864c..ea17318a 100644 --- a/commands/General/staff.js +++ b/commands/General/staff.js @@ -37,6 +37,6 @@ class Staff extends Command { embeds: [embed] }); } -}; +} module.exports = Staff; \ No newline at end of file diff --git a/commands/General/stats.js b/commands/General/stats.js index e0d0d0f9..b4f09f86 100644 --- a/commands/General/stats.js +++ b/commands/General/stats.js @@ -58,6 +58,6 @@ class Stats extends Command { embeds: [statsEmbed] }); } -}; +} module.exports = Stats; \ No newline at end of file diff --git a/commands/General/suggest.js b/commands/General/suggest.js index 6efa0bbd..7a5d0444 100644 --- a/commands/General/suggest.js +++ b/commands/General/suggest.js @@ -59,6 +59,6 @@ class Suggest extends Command { channel: suggChannel.toString() }); } -}; +} module.exports = Suggest; \ No newline at end of file diff --git a/commands/General/translate.js b/commands/General/translate.js index f06a9a52..0e5e226c 100644 --- a/commands/General/translate.js +++ b/commands/General/translate.js @@ -29,7 +29,7 @@ class Translate extends Command { message.error("misc:CANNOT_DM"); }); return; - }; + } const pWait = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" @@ -67,6 +67,6 @@ class Translate extends Command { embeds: [resEmbed] }); } -}; +} module.exports = Translate; \ No newline at end of file diff --git a/commands/General/userinfo.js b/commands/General/userinfo.js index 26e78276..0afdf6c5 100644 --- a/commands/General/userinfo.js +++ b/commands/General/userinfo.js @@ -32,8 +32,8 @@ class Userinfo extends Command { if (!user) { user = await this.client.users.fetch(args[0], true).catch(() => {}); displayPresence = false; - }; - }; + } + } if (!user) return message.error("general/userinfo:INVALID_USER"); @@ -68,23 +68,23 @@ class Userinfo extends Command { if (displayPresence) { if (member.presence.activities[0].name === "Custom Status") { - embed.addField(this.client.customEmojis.games + " " + message.translate("common:GAME"), (member.presence.activities[0] ? `Пользовательский статус\n${member.presence.activities[0].state || message.translate("common:NOT_DEFINED")}` : message.translate("general/userinfo:NO_GAME")), true) + embed.addField(this.client.customEmojis.games + " " + message.translate("common:GAME"), (member.presence.activities[0] ? `Пользовательский статус\n${member.presence.activities[0].state || message.translate("common:NOT_DEFINED")}` : message.translate("general/userinfo:NO_GAME")), true); embed.addField(this.client.customEmojis.status[member.presence.status] + " " + message.translate("common:STATUS"), message.translate("common:STATUS_" + (member.presence.status.toUpperCase())), true); } else { - embed.addField(this.client.customEmojis.games + " " + message.translate("common:GAME"), (member.presence.activities[0] ? `${member.presence.activities[0].name}\n${member.presence.activities[0].details}\n${member.presence.activities[0].state}` : message.translate("general/userinfo:NO_GAME")), true) + embed.addField(this.client.customEmojis.games + " " + message.translate("common:GAME"), (member.presence.activities[0] ? `${member.presence.activities[0].name}\n${member.presence.activities[0].details}\n${member.presence.activities[0].state}` : message.translate("general/userinfo:NO_GAME")), true); embed.addField(this.client.customEmojis.status[member.presence.status] + " " + message.translate("common:STATUS"), message.translate("common:STATUS_" + (member.presence.status.toUpperCase())), true); - }; - }; + } + } if (member) { // embed.addField(this.client.customEmojis.up + " " + message.translate("general/userinfo:ROLE"), (member.roles.highest ? member.roles.highest : message.translate("general/userinfo:NO_ROLE")), true) - embed.addField(this.client.customEmojis.calendar2 + " " + message.translate("common:JOIN"), message.printDate(member.joinedAt), true) - embed.addField(this.client.customEmojis.color + " " + message.translate("common:COLOR"), member.displayHexColor, true) - embed.addField(this.client.customEmojis.pencil + " " + message.translate("common:NICKNAME"), (member.nickname ? member.nickname : message.translate("general/userinfo:NO_NICKNAME")), true) + embed.addField(this.client.customEmojis.calendar2 + " " + message.translate("common:JOIN"), message.printDate(member.joinedAt), true); + embed.addField(this.client.customEmojis.color + " " + message.translate("common:COLOR"), member.displayHexColor, true); + embed.addField(this.client.customEmojis.pencil + " " + message.translate("common:NICKNAME"), (member.nickname ? member.nickname : message.translate("general/userinfo:NO_NICKNAME")), true); embed.addField(this.client.customEmojis.roles + " " + message.translate("common:ROLES"), (member.roles.size > 10 ? member.roles.cache.map((r) => r).slice(0, 9).join(", ") + " " + message.translate("general/userinfo:MORE_ROLES", { count: member.roles.cache.size - 10 }) : (member.roles.cache.size < 1) ? message.translate("general/userinfo:NO_ROLE") : member.roles.cache.map((r) => r).join(", "))); - }; + } if (user.bot && this.client.config.apiKeys.dbl && (this.client.config.apiKeys.dbl !== "")) { const res = await fetch("https://discordbots.org/api/bots/" + user.id, { @@ -102,13 +102,13 @@ class Userinfo extends Command { lib: data.lib || "unknown" }), true) .addField(this.client.customEmojis.link + " " + message.translate("common:LINKS"), `${data.support ? `[${message.translate("common:SUPPORT")}](${data.support}) | ` : ""}${data.invite ? `[${message.translate("common:INVITE")}](${data.invite}) | ` : ""}${data.github ? `[GitHub](${data.github}) | ` : ""}${data.website ? `[${message.translate("common:WEBSITE")}](${data.website})` : ""}`, true); - }; - }; + } + } message.channel.send({ embeds: [embed] }); } -}; +} module.exports = Userinfo; \ No newline at end of file diff --git a/commands/Images/approved.js b/commands/Images/approved.js index e4c8b551..7b1bb1b1 100644 --- a/commands/Images/approved.js +++ b/commands/Images/approved.js @@ -1,5 +1,4 @@ -const Command = require("../../base/Command.js"), - Discord = require("discord.js"); +const Command = require("../../base/Command.js"); class Approved extends Command { constructor(client) { @@ -13,7 +12,7 @@ class Approved extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -36,6 +35,6 @@ class Approved extends Command { }] }); } -}; +} module.exports = Approved; \ No newline at end of file diff --git a/commands/Images/avatar.js b/commands/Images/avatar.js index 78adf59b..c81f0089 100644 --- a/commands/Images/avatar.js +++ b/commands/Images/avatar.js @@ -1,5 +1,4 @@ -const Command = require("../../base/Command.js"), - Discord = require("discord.js"); +const Command = require("../../base/Command.js"); class Avatar extends Command { constructor(client) { @@ -13,7 +12,7 @@ class Avatar extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -34,6 +33,6 @@ class Avatar extends Command { }] }); } -}; +} module.exports = Avatar; \ No newline at end of file diff --git a/commands/Images/batslap.js b/commands/Images/batslap.js index 4e50fccd..4345749c 100644 --- a/commands/Images/batslap.js +++ b/commands/Images/batslap.js @@ -1,5 +1,4 @@ -const Command = require("../../base/Command.js"), - Discord = require("discord.js"); +const Command = require("../../base/Command.js"); class BatSlap extends Command { constructor(client) { @@ -13,7 +12,7 @@ class BatSlap extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -43,6 +42,6 @@ class BatSlap extends Command { }] }); } -}; +} module.exports = BatSlap; \ No newline at end of file diff --git a/commands/Images/beautiful.js b/commands/Images/beautiful.js index a5ebc116..35401cb0 100644 --- a/commands/Images/beautiful.js +++ b/commands/Images/beautiful.js @@ -1,5 +1,4 @@ -const Command = require("../../base/Command.js"), - Discord = require("discord.js"); +const Command = require("../../base/Command.js"); class Beautiful extends Command { constructor(client) { @@ -13,7 +12,7 @@ class Beautiful extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -36,6 +35,6 @@ class Beautiful extends Command { }] }); } -}; +} module.exports = Beautiful; \ No newline at end of file diff --git a/commands/Images/bed.js b/commands/Images/bed.js index 3e3413cc..53cad500 100644 --- a/commands/Images/bed.js +++ b/commands/Images/bed.js @@ -1,5 +1,4 @@ const Command = require("../../base/Command.js"), - Discord = require("discord.js"), canvacord = require("canvacord"); class Bed extends Command { @@ -14,7 +13,7 @@ class Bed extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -45,8 +44,8 @@ class Bed extends Command { m.error("misc:ERROR_OCCURRED", null, { edit: true }); - }; + } } -}; +} module.exports = Bed; \ No newline at end of file diff --git a/commands/Images/brazzers.js b/commands/Images/brazzers.js index bfddbafd..f1e6c3ca 100644 --- a/commands/Images/brazzers.js +++ b/commands/Images/brazzers.js @@ -1,5 +1,4 @@ -const Command = require("../../base/Command.js"), - Discord = require("discord.js"); +const Command = require("../../base/Command.js"); class Brazzers extends Command { constructor(client) { @@ -13,7 +12,7 @@ class Brazzers extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -36,6 +35,6 @@ class Brazzers extends Command { }] }); } -}; +} module.exports = Brazzers; \ No newline at end of file diff --git a/commands/Images/burn.js b/commands/Images/burn.js index 990ca229..50936f7b 100644 --- a/commands/Images/burn.js +++ b/commands/Images/burn.js @@ -1,5 +1,4 @@ -const Command = require("../../base/Command.js"), - Discord = require("discord.js"); +const Command = require("../../base/Command.js"); class Burn extends Command { constructor(client) { @@ -13,7 +12,7 @@ class Burn extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -36,6 +35,6 @@ class Burn extends Command { }] }); } -}; +} module.exports = Burn; \ No newline at end of file diff --git a/commands/Images/captcha.js b/commands/Images/captcha.js index ae4a4139..929f69cd 100644 --- a/commands/Images/captcha.js +++ b/commands/Images/captcha.js @@ -1,5 +1,4 @@ const Command = require("../../base/Command.js"), - Discord = require("discord.js"), fetch = require("node-fetch"); class Captcha extends Command { @@ -14,7 +13,7 @@ class Captcha extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -38,8 +37,8 @@ class Captcha extends Command { m.error("misc:ERR_OCCURRED", null, { edit: true }); - }; + } } -}; +} module.exports = Captcha; \ No newline at end of file diff --git a/commands/Images/challenger.js b/commands/Images/challenger.js index e2108af5..fed03f59 100644 --- a/commands/Images/challenger.js +++ b/commands/Images/challenger.js @@ -1,5 +1,4 @@ -const Command = require("../../base/Command.js"), - Discord = require("discord.js"); +const Command = require("../../base/Command.js"); class Challenger extends Command { constructor(client) { @@ -13,7 +12,7 @@ class Challenger extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -36,6 +35,6 @@ class Challenger extends Command { }] }); } -}; +} module.exports = Challenger; \ No newline at end of file diff --git a/commands/Images/clyde.js b/commands/Images/clyde.js index db90510c..fe7c7c6f 100644 --- a/commands/Images/clyde.js +++ b/commands/Images/clyde.js @@ -1,5 +1,4 @@ const Command = require("../../base/Command.js"), - Discord = require("discord.js"), fetch = require("node-fetch"); class Clyde extends Command { @@ -14,7 +13,7 @@ class Clyde extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -40,8 +39,8 @@ class Clyde extends Command { m.error("misc:ERROR_OCCURRED", null, { edit: true }); - }; + } } -}; +} module.exports = Clyde; \ No newline at end of file diff --git a/commands/Images/dictator.js b/commands/Images/dictator.js index 90a13f54..1e1140e0 100644 --- a/commands/Images/dictator.js +++ b/commands/Images/dictator.js @@ -1,5 +1,4 @@ -const Command = require("../../base/Command.js"), - Discord = require("discord.js"); +const Command = require("../../base/Command.js"); class Dictator extends Command { constructor(client) { @@ -13,7 +12,7 @@ class Dictator extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -36,6 +35,6 @@ class Dictator extends Command { }] }); } -}; +} module.exports = Dictator; \ No newline at end of file diff --git a/commands/Images/facepalm.js b/commands/Images/facepalm.js index 41aa2f73..9c6cd58b 100644 --- a/commands/Images/facepalm.js +++ b/commands/Images/facepalm.js @@ -1,6 +1,5 @@ const Command = require("../../base/Command.js"), - Canvas = require("canvas"), - Discord = require("discord.js"); + Canvas = require("canvas"); class Facepalm extends Command { constructor(client) { @@ -14,7 +13,7 @@ class Facepalm extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -50,6 +49,6 @@ class Facepalm extends Command { }] }); } -}; +} module.exports = Facepalm; \ No newline at end of file diff --git a/commands/Images/fire.js b/commands/Images/fire.js index 53b3b62e..d17929b4 100644 --- a/commands/Images/fire.js +++ b/commands/Images/fire.js @@ -1,5 +1,4 @@ -const Command = require("../../base/Command.js"), - Discord = require("discord.js"); +const Command = require("../../base/Command.js"); class Fire extends Command { constructor(client) { @@ -13,7 +12,7 @@ class Fire extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -36,6 +35,6 @@ class Fire extends Command { }] }); } -}; +} module.exports = Fire; \ No newline at end of file diff --git a/commands/Images/jail.js b/commands/Images/jail.js index c5e5a1b0..f301e221 100644 --- a/commands/Images/jail.js +++ b/commands/Images/jail.js @@ -1,5 +1,4 @@ -const Command = require("../../base/Command.js"), - Discord = require("discord.js"); +const Command = require("../../base/Command.js"); class Jail extends Command { constructor(client) { @@ -13,7 +12,7 @@ class Jail extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -36,6 +35,6 @@ class Jail extends Command { }] }); } -}; +} module.exports = Jail; \ No newline at end of file diff --git a/commands/Images/love.js b/commands/Images/love.js index dfc4f5e3..d2d7e5bc 100644 --- a/commands/Images/love.js +++ b/commands/Images/love.js @@ -1,5 +1,4 @@ const Command = require("../../base/Command.js"), - Discord = require("discord.js"), fetch = require("node-fetch"); class Love extends Command { @@ -14,7 +13,7 @@ class Love extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -41,8 +40,8 @@ class Love extends Command { m.error("misc:ERROR_OCCURRED", null, { edit: true }); - }; + } } -}; +} module.exports = Love; \ No newline at end of file diff --git a/commands/Images/mission.js b/commands/Images/mission.js index 31137d4e..880804f5 100644 --- a/commands/Images/mission.js +++ b/commands/Images/mission.js @@ -1,5 +1,4 @@ -const Command = require("../../base/Command.js"), - Discord = require("discord.js"); +const Command = require("../../base/Command.js"); class Mission extends Command { constructor(client) { @@ -13,7 +12,7 @@ class Mission extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -36,6 +35,6 @@ class Mission extends Command { }] }); } -}; +} module.exports = Mission; \ No newline at end of file diff --git a/commands/Images/phcomment.js b/commands/Images/phcomment.js index de862091..b04c062f 100644 --- a/commands/Images/phcomment.js +++ b/commands/Images/phcomment.js @@ -1,5 +1,4 @@ const Command = require("../../base/Command.js"), - Discord = require("discord.js"), canvacord = require("canvacord"); class Phcomment extends Command { @@ -14,7 +13,7 @@ class Phcomment extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -22,17 +21,15 @@ class Phcomment extends Command { let user = await this.client.resolveUser(args[0]); let text = args.join(" "); - if (user) { - text = args.slice(1).join(" "); - } else { - user = message.author; - }; + if (user) text = args.slice(1).join(" "); + else user = message.author; if (!text) return message.error("images/phcomment:MISSING_TEXT"); const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" }); + try { const buffer = await canvacord.Canvas.phub({ username: user.username, @@ -53,8 +50,8 @@ class Phcomment extends Command { m.error("misc:ERROR_OCCURRED", null, { edit: true }); - }; + } } -}; +} module.exports = Phcomment; \ No newline at end of file diff --git a/commands/Images/qrcode.js b/commands/Images/qrcode.js index 51f562b7..099d0205 100644 --- a/commands/Images/qrcode.js +++ b/commands/Images/qrcode.js @@ -33,8 +33,7 @@ class Qrcode extends Command { content: message.translate("images/qrcode:SUCCESS"), embeds: [embed] }); - } -}; +} module.exports = Qrcode; \ No newline at end of file diff --git a/commands/Images/rip.js b/commands/Images/rip.js index dc1d5333..e4e462af 100644 --- a/commands/Images/rip.js +++ b/commands/Images/rip.js @@ -1,5 +1,4 @@ -const Command = require("../../base/Command.js"), - Discord = require("discord.js"); +const Command = require("../../base/Command.js"); class Rip extends Command { constructor(client) { @@ -13,7 +12,7 @@ class Rip extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -36,6 +35,6 @@ class Rip extends Command { }] }); } -}; +} module.exports = Rip; \ No newline at end of file diff --git a/commands/Images/scary.js b/commands/Images/scary.js index f5922a8c..f09593ac 100644 --- a/commands/Images/scary.js +++ b/commands/Images/scary.js @@ -1,5 +1,4 @@ -const Command = require("../../base/Command.js"), - Discord = require("discord.js"); +const Command = require("../../base/Command.js"); class Scary extends Command { constructor(client) { @@ -13,7 +12,7 @@ class Scary extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -36,6 +35,6 @@ class Scary extends Command { }] }); } -}; +} module.exports = Scary; \ No newline at end of file diff --git a/commands/Images/tobecontinued.js b/commands/Images/tobecontinued.js index ed473f04..34605b01 100644 --- a/commands/Images/tobecontinued.js +++ b/commands/Images/tobecontinued.js @@ -1,5 +1,4 @@ -const Command = require("../../base/Command.js"), - Discord = require("discord.js"); +const Command = require("../../base/Command.js"); class Tobecontinued extends Command { constructor(client) { @@ -13,7 +12,7 @@ class Tobecontinued extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -36,6 +35,6 @@ class Tobecontinued extends Command { }] }); } -}; +} module.exports = Tobecontinued; \ No newline at end of file diff --git a/commands/Images/trash.js b/commands/Images/trash.js index d455ea32..11135d8d 100644 --- a/commands/Images/trash.js +++ b/commands/Images/trash.js @@ -1,5 +1,4 @@ const Command = require("../../base/Command.js"), - Discord = require("discord.js"), canvacord = require("canvacord"); class Trash extends Command { @@ -14,7 +13,7 @@ class Trash extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -35,6 +34,6 @@ class Trash extends Command { }] }); } -}; +} module.exports = Trash; \ No newline at end of file diff --git a/commands/Images/triggered.js b/commands/Images/triggered.js index 8cfa36f7..7783f945 100644 --- a/commands/Images/triggered.js +++ b/commands/Images/triggered.js @@ -1,5 +1,4 @@ -const Command = require("../../base/Command.js"), - Discord = require("discord.js"); +const Command = require("../../base/Command.js"); class Triggered extends Command { constructor(client) { @@ -13,7 +12,7 @@ class Triggered extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -38,6 +37,6 @@ class Triggered extends Command { }] }); } -}; +} module.exports = Triggered; \ No newline at end of file diff --git a/commands/Images/tweet.js b/commands/Images/tweet.js index f08ed12e..5b2d8f7b 100644 --- a/commands/Images/tweet.js +++ b/commands/Images/tweet.js @@ -1,5 +1,4 @@ -const Command = require("../../base/Command.js"), - Discord = require("discord.js"); +const Command = require("../../base/Command.js"); class Tweet extends Command { constructor(client) { @@ -13,7 +12,7 @@ class Tweet extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -47,6 +46,6 @@ class Tweet extends Command { }] }); } -}; +} module.exports = Tweet; \ No newline at end of file diff --git a/commands/Images/wanted.js b/commands/Images/wanted.js index 19a863e6..ea616592 100644 --- a/commands/Images/wanted.js +++ b/commands/Images/wanted.js @@ -1,5 +1,4 @@ -const Command = require("../../base/Command.js"), - Discord = require("discord.js"); +const Command = require("../../base/Command.js"); class Wanted extends Command { constructor(client) { @@ -13,7 +12,7 @@ class Wanted extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -36,6 +35,6 @@ class Wanted extends Command { }] }); } -}; +} module.exports = Wanted; \ No newline at end of file diff --git a/commands/Images/wasted.js b/commands/Images/wasted.js index 9a2c19ac..736a293e 100644 --- a/commands/Images/wasted.js +++ b/commands/Images/wasted.js @@ -1,5 +1,4 @@ -const Command = require("../../base/Command.js"), - Discord = require("discord.js"); +const Command = require("../../base/Command.js"); class Wasted extends Command { constructor(client) { @@ -13,7 +12,7 @@ class Wasted extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -36,6 +35,6 @@ class Wasted extends Command { }] }); } -}; +} module.exports = Wasted; \ No newline at end of file diff --git a/commands/Images/youtube-comment.js b/commands/Images/youtube-comment.js index 7350b154..71fcf53a 100644 --- a/commands/Images/youtube-comment.js +++ b/commands/Images/youtube-comment.js @@ -1,5 +1,4 @@ const Command = require("../../base/Command.js"), - Discord = require("discord.js"), canvacord = require("canvacord"); class YouTubeComment extends Command { @@ -14,7 +13,7 @@ class YouTubeComment extends Command { botPermissions: ["SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES"], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 3000 }); } @@ -22,11 +21,8 @@ class YouTubeComment extends Command { let user = await this.client.resolveUser(args[0]); let text = args.join(" "); - if (user) { - text = args.slice(1).join(" "); - } else { - user = message.author; - }; + if (user) text = args.slice(1).join(" "); + else user = message.author; if (!text) return message.error("images/phcomment:MISSING_TEXT"); // same text as phcomment @@ -48,6 +44,6 @@ class YouTubeComment extends Command { }] }); } -}; +} module.exports = YouTubeComment; \ No newline at end of file diff --git a/commands/Moderation/announcement.js b/commands/Moderation/announcement.js index 69231b39..0730c57b 100644 --- a/commands/Moderation/announcement.js +++ b/commands/Moderation/announcement.js @@ -38,7 +38,7 @@ class Announcement extends Command { tmsg.delete(); msg.delete(); collector.stop(true); - }; + } if (tmsg.content.toLowerCase() === message.translate("common:YES").toLowerCase()) { tmsg.delete(); @@ -63,12 +63,12 @@ class Announcement extends Command { m.delete(); collector.stop(true); c.stop(true); - }; + } }); c.on("end", (collected, reason) => { if (reason === "time") return message.error("misc:TIMES_UP"); }); - }; + } }); collector.on("end", (collected, reason) => { @@ -91,6 +91,6 @@ class Announcement extends Command { }); }); } -}; +} module.exports = Announcement; \ No newline at end of file diff --git a/commands/Moderation/ban.js b/commands/Moderation/ban.js index b6569234..a6897ad1 100644 --- a/commands/Moderation/ban.js +++ b/commands/Moderation/ban.js @@ -44,7 +44,7 @@ class Ban extends Command { const moderationPosition = message.member.roles.highest.position; if (message.member.ownerId !== message.author.id && !(moderationPosition > memberPosition)) return message.error("moderation/ban:SUPERIOR"); if (!member.bannable) return message.error("moderation/ban:MISSING_PERM"); - }; + } await user.send(message.translate("moderation/ban:BANNED_DM", { username: user.tag, @@ -77,7 +77,7 @@ class Ban extends Command { if (memberData) { memberData.sanctions.push(caseInfo); memberData.save(); - }; + } data.guild.casesCount++; data.guild.save(); @@ -98,13 +98,13 @@ class Ban extends Command { channel.send({ embeds: [embed] }); - }; + } }).catch((err) => { console.log(err); return message.error("moderation/ban:MISSING_PERM"); }); } -}; +} module.exports = Ban; \ No newline at end of file diff --git a/commands/Moderation/clear.js b/commands/Moderation/clear.js index 03887b43..818b3053 100644 --- a/commands/Moderation/clear.js +++ b/commands/Moderation/clear.js @@ -33,7 +33,7 @@ class Clear extends Command { return newChannel.send({ content: message.translate("moderation/clear:CHANNEL_CLEARED") }); - }; + } let amount = args[0]; if (!amount || isNaN(amount) || parseInt(amount) < 1) return message.error("moderation/clear:MISSING_AMOUNT"); @@ -64,12 +64,12 @@ class Clear extends Command { toDelete = await message.success("moderation/clear:CLEARED", { amount: `${--amount} ${message.getNoun(--amount, message.translate("misc:NOUNS:MESSAGES:1"), message.translate("misc:NOUNS:MESSAGES:2"), message.translate("misc:NOUNS:MESSAGES:5"))}` }); - }; + } setTimeout(function () { toDelete.delete(); }, 2000); } -}; +} module.exports = Clear; \ No newline at end of file diff --git a/commands/Moderation/clearsanctions.js b/commands/Moderation/clearsanctions.js index 4fdc8711..744c05d2 100644 --- a/commands/Moderation/clearsanctions.js +++ b/commands/Moderation/clearsanctions.js @@ -30,6 +30,6 @@ class Clearwarns extends Command { username: member.user.tag }); } -}; +} module.exports = Clearwarns; \ No newline at end of file diff --git a/commands/Moderation/giveaway.js b/commands/Moderation/giveaway.js index 1af96c70..1d3b471e 100644 --- a/commands/Moderation/giveaway.js +++ b/commands/Moderation/giveaway.js @@ -117,11 +117,11 @@ class Giveaway extends Command { return message.error("moderation/giveaway:NOT_FOUND", { messageID }); - }; + } } else { return message.error("moderation/giveaway:MISSING_STATUS"); } } -}; +} module.exports = Giveaway; \ No newline at end of file diff --git a/commands/Moderation/kick.js b/commands/Moderation/kick.js index 7a48b9e1..fc8dbaf6 100644 --- a/commands/Moderation/kick.js +++ b/commands/Moderation/kick.js @@ -85,12 +85,12 @@ class Kick extends Command { channel.send({ embeds: [embed] }); - }; + } }).catch(() => { return message.error("moderation/kick:MISSING_PERM"); }); } -}; +} module.exports = Kick; \ No newline at end of file diff --git a/commands/Moderation/mute.js b/commands/Moderation/mute.js index 535b7de0..f6b349da 100644 --- a/commands/Moderation/mute.js +++ b/commands/Moderation/mute.js @@ -106,6 +106,6 @@ class Mute extends Command { }); } } -}; +} module.exports = Mute; \ No newline at end of file diff --git a/commands/Moderation/poll.js b/commands/Moderation/poll.js index 232818b3..9fa67e3c 100644 --- a/commands/Moderation/poll.js +++ b/commands/Moderation/poll.js @@ -37,7 +37,7 @@ class Poll extends Command { tmsg.delete(); msg.delete(); collector.stop(true); - }; + } if (tmsg.content.toLowerCase() === message.translate("common:YES").toLowerCase()) { tmsg.delete(); @@ -63,12 +63,12 @@ class Poll extends Command { m.delete(); collector.stop(true); c.stop(true); - }; + } }); c.on("end", (collected, reason) => { if (reason === "time") return message.error("misc:TIMES_UP"); }); - }; + } }); collector.on("end", (collected, reason) => { @@ -101,6 +101,6 @@ class Poll extends Command { }); }); } -}; +} module.exports = Poll; \ No newline at end of file diff --git a/commands/Moderation/sanctions.js b/commands/Moderation/sanctions.js index f14cb88a..f05f0d17 100644 --- a/commands/Moderation/sanctions.js +++ b/commands/Moderation/sanctions.js @@ -51,11 +51,11 @@ class Sanctions extends Command { memberData.sanctions.forEach((s) => { embed.addField(s.type + " | #" + s.case, `${message.translate("common:MODERATOR")}: <@${s.moderator}>\n${message.translate("common:REASON")}: ${s.reason}`, true); }); - }; + } message.channel.send({ embeds: [embed] }); } -}; +} module.exports = Sanctions; \ No newline at end of file diff --git a/commands/Moderation/setwarns.js b/commands/Moderation/setwarns.js index 306f0438..a5f271d3 100644 --- a/commands/Moderation/setwarns.js +++ b/commands/Moderation/setwarns.js @@ -39,8 +39,8 @@ class Setwarns extends Command { prefix: data.guild.prefix, count: `${number} ${message.getNoun(number, message.translate("misc:NOUNS:WARNS:1"), message.translate("misc:NOUNS:WARNS:2"), message.translate("misc:NOUNS:WARNS:5"))}` }); - }; - }; + } + } if (!number || isNaN(number)) return message.error("misc:INVALID_NUMBER"); if (number < 1 || number > 10) return message.error("misc:INVALID_NUMBER_RANGE", 1, 10); @@ -61,8 +61,8 @@ class Setwarns extends Command { prefix: data.guild.prefix, count: `${number} ${message.getNoun(number, message.translate("misc:NOUNS:WARNS:1"), message.translate("misc:NOUNS:WARNS:2"), message.translate("misc:NOUNS:WARNS:5"))}` }); - }; + } } -}; +} module.exports = Setwarns; \ No newline at end of file diff --git a/commands/Moderation/unban.js b/commands/Moderation/unban.js index 8829c674..8f2f3816 100644 --- a/commands/Moderation/unban.js +++ b/commands/Moderation/unban.js @@ -36,9 +36,9 @@ class Unban extends Command { return message.error("misc:NO_USER_FOUND_ID", { id: args[0] }); - }; + } user = this.client.users.filter((u) => u.username === arr[0]).find((u) => u.discriminator === arr[1]); - }; + } if (!user) return message.error("misc:NO_USER_FOUND_ID", { id: args[0] }); @@ -55,6 +55,6 @@ class Unban extends Command { server: message.guild.name }); } -}; +} module.exports = Unban; \ No newline at end of file diff --git a/commands/Moderation/unmute.js b/commands/Moderation/unmute.js index e96239a2..943295f9 100644 --- a/commands/Moderation/unmute.js +++ b/commands/Moderation/unmute.js @@ -40,8 +40,8 @@ class Unmute extends Command { message.error("moderation/unmute:NOT_MUTED", { username: member.user.tag }); - }; + } } -}; +} module.exports = Unmute; \ No newline at end of file diff --git a/commands/Moderation/warn.js b/commands/Moderation/warn.js index da40e684..03e450f2 100644 --- a/commands/Moderation/warn.js +++ b/commands/Moderation/warn.js @@ -68,18 +68,18 @@ class Warn extends Command { })); caseInfo.type = "ban"; embed.setAuthor({ - name: message.translate("moderation/ban:CASE", { - count: data.guild.casesCount - }) + name: message.translate("moderation/ban:CASE", { + count: data.guild.casesCount }) + }) .setColor("#e02316"); message.guild.members.ban(member).catch(() => {}); message.success("moderation/setwarns:AUTO_BAN", { username: member.user.tag, count: banCount }); - }; - }; + } + } if (kickCount) { if (sanctions >= kickCount) { @@ -91,18 +91,18 @@ class Warn extends Command { })); caseInfo.type = "kick"; embed.setAuthor({ - name: message.translate("moderation/kick:CASE", { - count: data.guild.casesCount - }) + name: message.translate("moderation/kick:CASE", { + count: data.guild.casesCount }) + }) .setColor("#e88709"); member.kick().catch(() => {}); message.success("moderation/setwarns:AUTO_KICK", { username: member.user.tag, count: kickCount }); - }; - }; + } + } member.send(message.translate("moderation/warn:WARNED_DM", { username: member.user.tag, @@ -112,10 +112,10 @@ class Warn extends Command { })); caseInfo.type = "warn"; embed.setAuthor({ - name: message.translate("moderation/warn:CASE", { - caseNumber: data.guild.casesCount - }) + name: message.translate("moderation/warn:CASE", { + caseNumber: data.guild.casesCount }) + }) .setColor("#8c14e2"); message.success("moderation/warn:WARNED", { username: member.user.tag, @@ -131,8 +131,8 @@ class Warn extends Command { channel.send({ embeds: [embed] }); - }; + } } -}; +} module.exports = Warn; \ No newline at end of file diff --git a/commands/Music/autoplay.js b/commands/Music/autoplay.js index c80c123f..8a927131 100644 --- a/commands/Music/autoplay.js +++ b/commands/Music/autoplay.js @@ -27,6 +27,6 @@ class AutoPlay extends Command { message.success(`music/autoplay:SUCCESS_${autoplay ? "ENABLED" : "DISABLED"}`); } -}; +} module.exports = AutoPlay; \ No newline at end of file diff --git a/commands/Music/back.js b/commands/Music/back.js index b2e24f4a..0d6add41 100644 --- a/commands/Music/back.js +++ b/commands/Music/back.js @@ -45,6 +45,6 @@ class Back extends Command { embeds: [embed] }); } -}; +} module.exports = Back; \ No newline at end of file diff --git a/commands/Music/clip.js b/commands/Music/clip.js index 690669d0..5b7390eb 100644 --- a/commands/Music/clip.js +++ b/commands/Music/clip.js @@ -51,8 +51,8 @@ class Clip extends Command { }, 60 * 1000); } catch (error) { console.error(error); - }; + } } -}; +} module.exports = Clip; \ No newline at end of file diff --git a/commands/Music/clips.js b/commands/Music/clips.js index d482a88c..7c95aa97 100644 --- a/commands/Music/clips.js +++ b/commands/Music/clips.js @@ -22,7 +22,7 @@ class Clips extends Command { fs.readdir("./clips", function (err, files) { if (err) return console.log("Unable to read directory: " + err); - let clips = []; + const clips = []; files.forEach(function (file) { clips.push(file.substring(0, file.length - 4)); @@ -41,6 +41,6 @@ class Clips extends Command { }); }); } -}; +} module.exports = Clips; \ No newline at end of file diff --git a/commands/Music/filter.js b/commands/Music/filter.js index c648fa12..9befd331 100644 --- a/commands/Music/filter.js +++ b/commands/Music/filter.js @@ -1,4 +1,4 @@ -const Command = require("../../base/Command.js") +const Command = require("../../base/Command.js"); class Filter extends Command { constructor(client) { @@ -36,6 +36,6 @@ class Filter extends Command { prefix: data.guild.prefix }); } -}; +} module.exports = Filter; \ No newline at end of file diff --git a/commands/Music/filters.js b/commands/Music/filters.js index 88771944..55f882a9 100644 --- a/commands/Music/filters.js +++ b/commands/Music/filters.js @@ -43,6 +43,6 @@ class Filters extends Command { embeds: [list] }); } -}; +} module.exports = Filters; \ No newline at end of file diff --git a/commands/Music/jump.js b/commands/Music/jump.js index 7d986a38..2c4a6164 100644 --- a/commands/Music/jump.js +++ b/commands/Music/jump.js @@ -48,6 +48,6 @@ class Jump extends Command { embeds: [embed] }); } -}; +} module.exports = Jump; \ No newline at end of file diff --git a/commands/Music/loop.js b/commands/Music/loop.js index a462c565..5f5a7ec9 100644 --- a/commands/Music/loop.js +++ b/commands/Music/loop.js @@ -31,10 +31,10 @@ class Loop extends Command { mode = this.client.player.setRepeatMode(message, 1); } else { mode = this.client.player.setRepeatMode(message, 0); - }; + } - message.success(`music/loop:${mode ? mode === 2 ? "QUEUE" : "SONG" : "DISABLED"}`) + message.success(`music/loop:${mode ? mode === 2 ? "QUEUE" : "SONG" : "DISABLED"}`); } -}; +} module.exports = Loop; \ No newline at end of file diff --git a/commands/Music/lyrics.js b/commands/Music/lyrics.js index e1381e34..837cba11 100644 --- a/commands/Music/lyrics.js +++ b/commands/Music/lyrics.js @@ -45,7 +45,7 @@ class Lyrics extends Command { return message.error("music/lyrics:NO_LYRICS_FOUND", { songName }); - }; + } embed.setDescription(lyrics); message.channel.send({ @@ -59,6 +59,6 @@ class Lyrics extends Command { }); } } -}; +} module.exports = Lyrics; \ No newline at end of file diff --git a/commands/Music/np.js b/commands/Music/np.js index 5ed3dc5b..a7913a84 100644 --- a/commands/Music/np.js +++ b/commands/Music/np.js @@ -52,6 +52,6 @@ class Np extends Command { embeds: [embed] }); } -}; +} module.exports = Np; \ No newline at end of file diff --git a/commands/Music/pause.js b/commands/Music/pause.js index c018d40d..15008997 100644 --- a/commands/Music/pause.js +++ b/commands/Music/pause.js @@ -27,6 +27,6 @@ class Pause extends Command { message.sendT("music/pause:SUCCESS"); } -}; +} module.exports = Pause; \ No newline at end of file diff --git a/commands/Music/play.js b/commands/Music/play.js index 0942c53e..db8d12f1 100644 --- a/commands/Music/play.js +++ b/commands/Music/play.js @@ -36,6 +36,6 @@ class Play extends Command { console.error(e); } } -}; +} module.exports = Play; \ No newline at end of file diff --git a/commands/Music/queue.js b/commands/Music/queue.js index 95ca9d49..44ef9f78 100644 --- a/commands/Music/queue.js +++ b/commands/Music/queue.js @@ -18,7 +18,7 @@ class Queue extends Command { }); } - async run(message, args, data, interaction) { + async run(message, args, data) { const voice = message.member.voice.channel; const queue = this.client.player.getQueue(message); @@ -38,7 +38,7 @@ class Queue extends Command { return message.channel.send({ embeds: [embed] }); - }; + } const FieldsEmbed = new Pagination.FieldsEmbed(); @@ -60,8 +60,8 @@ class Queue extends Command { .setDeleteOnTimeout(true) .setPageIndicator(true) .formatField("Очередь", (track) => `[${track.name}](${track.url})\n*Добавил ${track.member}*\n`) - .build(); + .build(); } -}; +} module.exports = Queue; \ No newline at end of file diff --git a/commands/Music/resume.js b/commands/Music/resume.js index c6fad087..c2424927 100644 --- a/commands/Music/resume.js +++ b/commands/Music/resume.js @@ -27,6 +27,6 @@ class Resume extends Command { message.sendT("music/resume:SUCCESS"); } -}; +} module.exports = Resume; \ No newline at end of file diff --git a/commands/Music/seek.js b/commands/Music/seek.js index c2d6d366..24b8b4b3 100644 --- a/commands/Music/seek.js +++ b/commands/Music/seek.js @@ -30,6 +30,6 @@ class Seek extends Command { message.sendT("music/seek:SUCCESS"); } -}; +} module.exports = Seek; \ No newline at end of file diff --git a/commands/Music/skip.js b/commands/Music/skip.js index 8dc74dcc..c8612076 100644 --- a/commands/Music/skip.js +++ b/commands/Music/skip.js @@ -47,6 +47,6 @@ class Skip extends Command { embeds: [embed] }); } -}; +} module.exports = Skip; \ No newline at end of file diff --git a/commands/Music/stop.js b/commands/Music/stop.js index 2a70d12a..cf19bc3f 100644 --- a/commands/Music/stop.js +++ b/commands/Music/stop.js @@ -43,6 +43,6 @@ class Stop extends Command { embeds: [embed] }); } -}; +} module.exports = Stop; \ No newline at end of file diff --git a/commands/NSFW/hentai.js b/commands/NSFW/hentai.js index 0921efa7..8b7b5623 100644 --- a/commands/NSFW/hentai.js +++ b/commands/NSFW/hentai.js @@ -26,81 +26,81 @@ class Hentai extends Command { .setFooter({ text: data.config.embed.footer }) - .setTimestamp() + .setTimestamp(); switch (category) { case "neko": gif = await fetch("https://nekos.life/api/v2/img/nsfw_neko_gif").then(response => response.json()); - embed.setImage(gif.url) + embed.setImage(gif.url); break; case "cum": gif = await fetch("https://nekos.life/api/v2/img/cum").then(response => response.json()); - embed.setImage(gif.url) + embed.setImage(gif.url); break; case "solo": gif = await fetch("https://nekos.life/api/v2/img/solo").then(response => response.json()); - embed.setImage(gif.url) + embed.setImage(gif.url); break; case "anal": gif = await fetch("https://nekos.life/api/v2/img/anal").then(response => response.json()); - embed.setImage(gif.url) + embed.setImage(gif.url); break; case "yuri": gif = await fetch("https://nekos.life/api/v2/img/yuri").then(response => response.json()); - embed.setImage(gif.url) + embed.setImage(gif.url); break; case "blowjob": gif = await fetch("https://nekos.life/api/v2/img/bj").then(response => response.json()); - embed.setImage(gif.url) + embed.setImage(gif.url); break; case "bj": gif = await fetch("https://nekos.life/api/v2/img/bj").then(response => response.json()); - embed.setImage(gif.url) + embed.setImage(gif.url); break; case "pussy": gif = await fetch("https://nekos.life/api/v2/img/pussy").then(response => response.json()); - embed.setImage(gif.url) + embed.setImage(gif.url); break; case "classic": gif = await fetch("https://nekos.life/api/v2/img/hentai").then(response => response.json()); - embed.setImage(gif.url) + embed.setImage(gif.url); break; case "futa": gif = await fetch("https://nekos.life/api/v2/img/futanari").then(response => response.json()); - embed.setImage(gif.url) + embed.setImage(gif.url); break; case "futanari": gif = await fetch("https://nekos.life/api/v2/img/futanari").then(response => response.json()); - embed.setImage(gif.url) + embed.setImage(gif.url); break; case "help": - embed.setTitle(message.translate("nsfw/hentai:HELP_1")) - embed.setDescription(message.translate("nsfw/hentai:HELP_2")) + embed.setTitle(message.translate("nsfw/hentai:HELP_1")); + embed.setDescription(message.translate("nsfw/hentai:HELP_2")); break; default: gif = await fetch("https://nekos.life/api/v2/img/Random_hentai_gif").then(response => response.json()); - embed.setImage(gif.url) + embed.setImage(gif.url); embed.setDescription(message.translate("nsfw/hentai:NOCATEGORY", { prefix: data.guild.prefix - })) + })); break; - }; + } message.channel.send({ embeds: [embed] }); } -}; +} module.exports = Hentai; \ No newline at end of file diff --git a/commands/Owner/debug.js b/commands/Owner/debug.js index 4269c056..cc203d6c 100644 --- a/commands/Owner/debug.js +++ b/commands/Owner/debug.js @@ -16,7 +16,7 @@ class Debug extends Command { }); } - async run(message, args, data) { + async run(message, args) { const action = args[0]; if (!action || !["set", "add"].includes(action)) return message.error("owner/debug:NO_ACTION"); @@ -60,7 +60,7 @@ class Debug extends Command { } else if (status === "bank") { memberData.bankSold = newValue; memberData.save(); - }; + } message.success("owner/debug:SUCCESS_" + status.toUpperCase(), { username: member.user.tag, @@ -87,14 +87,14 @@ class Debug extends Command { newValue = memberData.bankSold + parseInt(amount, 10); memberData.bankSold = newValue; memberData.save(); - }; + } message.success("owner/debug:SUCCESS_" + status.toUpperCase(), { username: member.user.tag, amount: newValue }); - }; + } } -}; +} module.exports = Debug; \ No newline at end of file diff --git a/commands/Owner/eval.js b/commands/Owner/eval.js index 4b471798..96f8e2ad 100644 --- a/commands/Owner/eval.js +++ b/commands/Owner/eval.js @@ -16,7 +16,7 @@ class Eval extends Command { }); } - async run(message, args, data) { + async run(message) { const content = message.content.split(" ").slice(1).join(" "); const result = new Promise((resolve) => resolve(eval(content))); @@ -37,6 +37,6 @@ class Eval extends Command { }); }); } -}; +} module.exports = Eval; \ No newline at end of file diff --git a/commands/Owner/reload.js b/commands/Owner/reload.js index f762987b..cc1094a7 100644 --- a/commands/Owner/reload.js +++ b/commands/Owner/reload.js @@ -32,6 +32,6 @@ class Reload extends Command { command: cmd.help.name }); } -}; +} module.exports = Reload; \ No newline at end of file diff --git a/commands/Owner/say.js b/commands/Owner/say.js index 240cb356..369ef355 100644 --- a/commands/Owner/say.js +++ b/commands/Owner/say.js @@ -16,11 +16,11 @@ class Say extends Command { }); } - async run(message, args, data) { + async run(message, args) { if (!args[0]) return message.delete(); // Arguments split - let split = "++"; + const split = "++"; args = args.join(" ").split(split); for (var i = 0; i < args.length; i++) args[i] = args[i].trim(); @@ -67,8 +67,8 @@ class Say extends Command { content: args[0] }); }, 2000); - }; + } } -}; +} module.exports = Say; \ No newline at end of file diff --git a/commands/Owner/servers-list.js b/commands/Owner/servers-list.js index 59c379c8..7a722701 100644 --- a/commands/Owner/servers-list.js +++ b/commands/Owner/servers-list.js @@ -26,9 +26,9 @@ class ServersList extends Command { let description = `${message.translate("common:SERVERS")}: ${this.client.guilds.cache.size}\n\n` + this.client.guilds.cache.sort((a, b) => b.memberCount - a.memberCount).map((r) => r) - .map((r, i) => `**${i + 1}** - ${r.name} | ${r.memberCount} ${message.translate("common:MEMBERS").toLowerCase()}`) - .slice(0, 10) - .join("\n"); + .map((r, i) => `**${i + 1}** - ${r.name} | ${r.memberCount} ${message.translate("common:MEMBERS").toLowerCase()}`) + .slice(0, 10) + .join("\n"); const embed = new Discord.MessageEmbed() .setAuthor({ @@ -73,9 +73,9 @@ class ServersList extends Command { description = `${message.translate("common:SERVERS")}: ${this.client.guilds.cache.size}\n\n` + this.client.guilds.cache.sort((a, b) => b.memberCount - a.memberCount).map((r) => r) - .map((r, i) => `**${i + 1}** - ${r.name} | ${r.memberCount} ${message.translate("common:MEMBERS")}`) - .slice(i0, i1) - .join("\n"); + .map((r, i) => `**${i + 1}** - ${r.name} | ${r.memberCount} ${message.translate("common:MEMBERS")}`) + .slice(i0, i1) + .join("\n"); // Update the embed with new informations embed.setTitle(`${message.translate("common:PAGE")}: ${page}/${Math.round(this.client.guilds.cache.size/10)}`) @@ -85,7 +85,7 @@ class ServersList extends Command { msg.edit({ embeds: [embed] }); - }; + } if (reaction._emoji.name === "➡" && !message.channel.type !== "DM") { // Updates variables @@ -99,9 +99,9 @@ class ServersList extends Command { description = `${message.translate("common:SERVERS")}: ${this.client.guilds.cache.size}\n\n` + this.client.guilds.cache.sort((a, b) => b.memberCount - a.memberCount).map((r) => r) - .map((r, i) => `**${i + 1}** - ${r.name} | ${r.memberCount} ${message.translate("common:MEMBERS").toLowerCase()}`) - .slice(i0, i1) - .join("\n"); + .map((r, i) => `**${i + 1}** - ${r.name} | ${r.memberCount} ${message.translate("common:MEMBERS").toLowerCase()}`) + .slice(i0, i1) + .join("\n"); // Update the embed with new informations embed.setTitle(`${message.translate("common:PAGE")}: ${page}/${Math.round(this.client.guilds.cache.size/10)}`) @@ -111,7 +111,7 @@ class ServersList extends Command { msg.edit({ embeds: [embed] }); - }; + } if (reaction._emoji.name === "❌" && !message.channel.type !== "DM") return msg.delete(); @@ -119,6 +119,6 @@ class ServersList extends Command { await reaction.users.remove(message.author.id); }); } -}; +} module.exports = ServersList; \ No newline at end of file diff --git a/dashboard/app.js b/dashboard/app.js index 39e4dd11..f57aed21 100644 --- a/dashboard/app.js +++ b/dashboard/app.js @@ -44,7 +44,7 @@ module.exports.load = async(client) => { req.translate = req.client.translations.get(req.locale); req.printDate = (date) => req.client.printDate(date, null, req.locale); req.convertTime = (time) => req.client.convertTime(time, "to", true, req.locale); - }; + } next(); }) .use("/api", discordAPIRouter) diff --git a/dashboard/auth/CheckAuth.js b/dashboard/auth/CheckAuth.js index a850b20c..42b6fc39 100644 --- a/dashboard/auth/CheckAuth.js +++ b/dashboard/auth/CheckAuth.js @@ -5,5 +5,5 @@ module.exports = async (req, res, next) => { const state = Math.random().toString(36).substring(5); req.client.states[state] = redirectURL; return res.redirect(`/api/login?state=${state}`); - }; + } }; \ No newline at end of file diff --git a/dashboard/routes/discord.js b/dashboard/routes/discord.js index 01e8e39c..c8d3c344 100644 --- a/dashboard/routes/discord.js +++ b/dashboard/routes/discord.js @@ -20,8 +20,8 @@ router.get("/callback", async (req, res) => { req.client.knownGuilds.push({ id: guildID, user: req.user.id }); return res.redirect(`/manage/${guildID}`); - }; - }; + } + } const redirectURL = req.client.states[req.query.state] || "/selector"; const params = new URLSearchParams(); @@ -56,7 +56,7 @@ router.get("/callback", async (req, res) => { const json = await response.json(); if (json.retry_after) await req.client.wait(json.retry_after); else userData.infos = json; - }; + } /* User guilds */ if (!userData.guilds) { @@ -67,8 +67,8 @@ router.get("/callback", async (req, res) => { const json = await response.json(); if (json.retry_after) await req.client.wait(json.retry_after); else userData.guilds = json; - }; - }; + } + } /* Change format (from "0": { data }, "1": { data }, etc... to [ { data }, { data } ]) */ const guilds = []; @@ -87,7 +87,7 @@ router.get("/callback", async (req, res) => { logsChannel.send({ embeds: [embed] }); userDB.logged = true; userDB.save(); - }; + } res.redirect(redirectURL); }); diff --git a/dashboard/routes/docs.js b/dashboard/routes/docs.js index 5f711325..3745d7c3 100644 --- a/dashboard/routes/docs.js +++ b/dashboard/routes/docs.js @@ -1,6 +1,5 @@ const express = require("express"), - router = express.Router(), - fs = require("fs"); + router = express.Router(); router.get("/", function (req, res) { res.render("docs", { diff --git a/dashboard/routes/guild-manager.js b/dashboard/routes/guild-manager.js index 9c16aa58..ecaa3a99 100644 --- a/dashboard/routes/guild-manager.js +++ b/dashboard/routes/guild-manager.js @@ -12,7 +12,7 @@ router.get("/:serverID", CheckAuth, async(req, res) => { translate: req.translate, currentURL: `${req.client.config.dashboard.baseURL}/${req.originalUrl}` }); - }; + } // Fetch guild informations const guildInfos = await utils.fetchGuild(guild.id, req.client, req.user.guilds); @@ -38,7 +38,7 @@ router.post("/:serverID", CheckAuth, async(req, res) => { translate: req.translate, currentURL: `${req.client.config.dashboard.baseURL}/${req.originalUrl}` }); - }; + } const guildData = await req.client.findOrCreateGuild({ id: guild.id }); const data = req.body; @@ -49,7 +49,7 @@ router.post("/:serverID", CheckAuth, async(req, res) => { if (data.prefix.length >= 1 && data.prefix.length < 2000) guildData.prefix = data.prefix; await guildData.save(); - }; + } if (Object.prototype.hasOwnProperty.call(data, "welcomeEnable") || Object.prototype.hasOwnProperty.call(data, "welcomeUpdate")) { const welcome = { @@ -61,7 +61,7 @@ router.post("/:serverID", CheckAuth, async(req, res) => { guildData.plugins.welcome = welcome; guildData.markModified("plugins.welcome"); await guildData.save(); - }; + } if (Object.prototype.hasOwnProperty.call(data, "welcomeDisable")) { const welcome = { @@ -73,7 +73,7 @@ router.post("/:serverID", CheckAuth, async(req, res) => { guildData.plugins.welcome = welcome; guildData.markModified("plugins.welcome"); await guildData.save(); - }; + } if (Object.prototype.hasOwnProperty.call(data, "goodbyeEnable") || Object.prototype.hasOwnProperty.call(data, "goodbyeUpdate")) { const goodbye = { @@ -85,7 +85,7 @@ router.post("/:serverID", CheckAuth, async(req, res) => { guildData.plugins.goodbye = goodbye; guildData.markModified("plugins.goodbye"); await guildData.save(); - }; + } if (Object.prototype.hasOwnProperty.call(data, "goodbyeDisable")) { const goodbye = { @@ -97,7 +97,7 @@ router.post("/:serverID", CheckAuth, async(req, res) => { guildData.plugins.goodbye = goodbye; guildData.markModified("plugins.goodbye"); await guildData.save(); - }; + } if (Object.prototype.hasOwnProperty.call(data, "autoroleEnable") || Object.prototype.hasOwnProperty.call(data, "autoroleUpdate")) { const autorole = { @@ -107,7 +107,7 @@ router.post("/:serverID", CheckAuth, async(req, res) => { guildData.plugins.autorole = autorole; guildData.markModified("plugins.autorole"); await guildData.save(); - }; + } if (Object.prototype.hasOwnProperty.call(data, "autoroleDisable")) { const autorole = { @@ -117,7 +117,7 @@ router.post("/:serverID", CheckAuth, async(req, res) => { guildData.plugins.autorole = autorole; guildData.markModified("plugins.autorole"); await guildData.save(); - }; + } if (Object.prototype.hasOwnProperty.call(data, "suggestions")) { if (data.suggestions === req.translate("common:NO_CHANNEL")) guildData.plugins.suggestions = false; @@ -130,7 +130,7 @@ router.post("/:serverID", CheckAuth, async(req, res) => { else guildData.plugins.birthdays = guild.channels.cache.find((ch) => "#" + ch.name === data.birthdays).id; guildData.markModified("plugins"); - }; + } await guildData.save(); diff --git a/dashboard/routes/guild-stats.js b/dashboard/routes/guild-stats.js index 863e0336..f0057c03 100644 --- a/dashboard/routes/guild-stats.js +++ b/dashboard/routes/guild-stats.js @@ -13,7 +13,7 @@ router.get("/:serverID", CheckAuth, async(req, res) => { language: req.language, currentURL: `${req.client.config.dashboard.baseURL}/${req.originalUrl}` }); - }; + } // Fetch guild informations const guildInfos = await utils.fetchGuild(guild.id, req.client, req.user.guilds); @@ -28,7 +28,7 @@ router.get("/:serverID", CheckAuth, async(req, res) => { for (const cat in leaderboards) { const e = leaderboards[cat]; if (e.length > 10) e.length = 10; - }; + } const stats = { money: await utils.fetchUsers(leaderboards.money, req.client), @@ -55,7 +55,7 @@ function getCommands(commands) { else aDateCommand[tDate] = 1; }); return aDateCommand; -}; +} function getCommandsUsage(commands) { const objectCount = commands.reduce((acc, curr) => { @@ -73,7 +73,7 @@ function getCommandsUsage(commands) { }); return percentages; -}; +} function getPercentagePerKey(myArray) { const sum = getSum(myArray); @@ -82,31 +82,31 @@ function getPercentagePerKey(myArray) { const val = myArray[key]; const percentage = Math.round((val / sum) * 100); arrayWithPercentages.push({key, percentage}); - }; + } return arrayWithPercentages; -}; +} function getSum(myArray) { let sum = 0; for (const key in myArray) sum += myArray[key]; return sum; -}; +} function sortArrayOfObjects(key, arr) { const array = arr.slice(0); return array.sort((a, b) => { return b[key] - a[key]; }); -}; +} function formatDate(date) { let dd = date.getDate(); let mm = date.getMonth() + 1; - if (dd < 10) dd = `0${dd}` - if (mm < 10) mm = `0${mm}` - date = `${mm}/${dd}` + if (dd < 10) dd = `0${dd}`; + if (mm < 10) mm = `0${mm}`; + date = `${mm}/${dd}`; return date; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/dashboard/routes/profile.js b/dashboard/routes/profile.js index 758a75c7..7097787c 100644 --- a/dashboard/routes/profile.js +++ b/dashboard/routes/profile.js @@ -21,8 +21,8 @@ router.post("/", CheckAuth, async function(req, res) { if (checkDate(data.birthdate)) { user.birthdate = checkDate(data.birthdate); user.markModified("birthdate"); - }; - }; + } + } await user.save(); res.redirect(303, "/profile"); @@ -47,4 +47,4 @@ function checkDate(birthdate) { if (d.getTime() < (Date.now() - 2.523e+12)) return false; return d; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/dashboard/utils.js b/dashboard/utils.js index 92e1b025..a3697953 100644 --- a/dashboard/utils.js +++ b/dashboard/utils.js @@ -11,7 +11,7 @@ async function fetchGuild(guildID, client, guilds) { const conf = await client.findOrCreateGuild({ id:guild.id }); return { ...guild, ...conf.toJSON(), ...guilds.find((g) => g.id === guild.id) }; -}; +} /** * Fetch user informations (stats, guilds, etc...) @@ -34,12 +34,12 @@ async function fetchUser(userData, client, query) { }); userData.displayedGuilds = userData.guilds.filter((g) => g.displayed && g.admin); if (userData.displayedGuilds.length < 1) delete userData.displayedGuilds; - }; + } const user = await client.users.fetch(userData.id); const userDb = await client.findOrCreateUser({ id: user.id }, true); const userInfos = { ...user.toJSON(), ...userDb, ...userData }; return userInfos; -}; +} module.exports = { fetchUser, fetchGuild }; \ No newline at end of file diff --git a/events/guildCreate.js b/events/guildCreate.js index e84c2549..ee38c290 100644 --- a/events/guildCreate.js +++ b/events/guildCreate.js @@ -10,8 +10,8 @@ module.exports = class { if ((!this.client.config.proUsers.includes(guild.ownerId) || this.guilds.filter((g) => g.ownerId === guild.ownerId) > 1) && guild.ownerId !== this.client.config.owner.id) { this.client.logger.log(`${guild.ownerId} tried to invite JaBa on its server.`); return guild.leave(); - }; - }; + } + } const messageOptions = {}; @@ -27,16 +27,16 @@ module.exports = class { }]; userData.markModified("achievements.invite"); await userData.save(); - }; + } const thanksEmbed = new Discord.MessageEmbed() .setAuthor({ name: "Спасибо что добавили меня на свой сервер!" }) - .setDescription(`Для настроек используйте \`${data.config.prefix}help\` и посмотрите на административные команды!\nЧтобы изменить язык используйте \`${this.client.config.prefix}setlang [язык]\`.`) - .setColor(data.config.embed.color) + .setDescription(`Для настроек используйте \`${this.client.config.prefix}help\` и посмотрите на административные команды!\nЧтобы изменить язык используйте \`${this.client.config.prefix}setlang [язык]\`.`) + .setColor(this.client.config.embed.color) .setFooter({ - text: data.config.embed.footer + text: this.client.config.embed.footer }) .setTimestamp(); messageOptions.embed = thanksEmbed; @@ -52,6 +52,6 @@ module.exports = class { }) .setColor("#32CD32") .setDescription(text); - this.client.channels.cache.get(data.config.support.logs).send(logsEmbed); + this.client.channels.cache.get(this.client.config.support.logs).send(logsEmbed); } }; \ No newline at end of file diff --git a/events/guildMemberAdd.js b/events/guildMemberAdd.js index 258cb765..e9164219 100644 --- a/events/guildMemberAdd.js +++ b/events/guildMemberAdd.js @@ -40,7 +40,7 @@ module.exports = class { CONNECT: false }).catch(() => {}); }); - }; + } // Check if the autorole is enabled if (guildData.plugins.autorole.enabled) member.roles.add(guildData.plugins.autorole.role).catch(() => {}); @@ -53,7 +53,7 @@ module.exports = class { .replace(/{user}/g, member) .replace(/{server}/g, member.guild.name) .replace(/{membercount}/g, member.guild.memberCount) - .replace(/{createdat}/g, this.client.printDate(member.user.createdAt)) + .replace(/{createdat}/g, this.client.printDate(member.user.createdAt)); if (guildData.plugins.welcome.withImage) { const canvas = Canvas.createCanvas(1024, 450), ctx = canvas.getContext("2d"); @@ -138,8 +138,8 @@ module.exports = class { channel.send({ content: message }); - }; - }; - }; + } + } + } } }; \ No newline at end of file diff --git a/events/guildMemberRemove.js b/events/guildMemberRemove.js index f1d91b86..03a52ca4 100644 --- a/events/guildMemberRemove.js +++ b/events/guildMemberRemove.js @@ -36,7 +36,7 @@ module.exports = class { .replace(/{user}/g, member.user.tag) .replace(/{server}/g, member.guild.name) .replace(/{membercount}/g, member.guild.memberCount) - .replace(/{createdat}/g, this.client.printDate(member.user.createdAt)) + .replace(/{createdat}/g, this.client.printDate(member.user.createdAt)); if (guildData.plugins.goodbye.withImage) { const canvas = Canvas.createCanvas(1024, 450), ctx = canvas.getContext("2d"); @@ -121,8 +121,8 @@ module.exports = class { channel.send({ content: message }); - }; - }; - }; + } + } + } } }; \ No newline at end of file diff --git a/events/guildMemberUpdate.js b/events/guildMemberUpdate.js index a4f83a6c..71bcef2b 100644 --- a/events/guildMemberUpdate.js +++ b/events/guildMemberUpdate.js @@ -21,6 +21,6 @@ module.exports = class { attachment: "./assets/img/achievements/achievement_unlocked5.png" }] }); - }; + } } }; \ No newline at end of file diff --git a/events/messageCreate.js b/events/messageCreate.js index 5f3fcbab..1a8c1283 100644 --- a/events/messageCreate.js +++ b/events/messageCreate.js @@ -25,13 +25,13 @@ module.exports = class { id: message.guild.id }); message.guild.data = data.guild = guild; - }; + } // Check if the bot was mentionned if (message.content.match(new RegExp(`^<@!?${client.user.id}>( |)$`))) { if (message.guild) return message.sendT("misc:HELLO_SERVER", { username: message.author.username, prefix: data.guild.prefix }); else return message.sendT("misc:HELLO_DM"); - }; + } if (message.content.includes("@someone") && message.guild) return client.commands.get("someone").run(message, null, data); @@ -42,7 +42,7 @@ module.exports = class { guildID: message.guild.id }); data.memberData = memberData; - }; + } const userData = await client.findOrCreateUser({ id: message.author.id @@ -65,17 +65,17 @@ module.exports = class { })); } else { uSlowmode.time = channelSlowmode.time + Date.now(); - }; + } } else { data.guild.slowmode.users.push({ id: message.author.id + message.channel.id, time: channelSlowmode.time + Date.now() }); - }; + } data.guild.markModified("slowmode.users"); await data.guild.save(); - }; - }; + } + } if (data.guild.plugins.automod.enabled && !data.guild.plugins.automod.ignored.includes(message.channel.id)) { if (/(discord\.(gg|io|me|li)\/.+|discordapp\.com\/invite\/.+)/i.test(message.content)) { @@ -85,9 +85,9 @@ module.exports = class { return message.error("administration/automod:DELETED", { username: message.author.tag }); - }; - }; - }; + } + } + } const afkReason = data.userData.afk; if (afkReason) { @@ -96,7 +96,7 @@ module.exports = class { message.sendT("general/setafk:DELETED", { username: message.author.username }); - }; + } message.mentions.users.forEach(async (u) => { const userData = await client.findOrCreateUser({ @@ -104,7 +104,7 @@ module.exports = class { }); if (userData.afk) message.error("general/setafk:IS_AFK", { user: u.tag, reason: userData.afk }); }); - }; + } // Gets the prefix const prefix = client.functions.getPrefix(message, data); @@ -125,7 +125,7 @@ module.exports = class { return message.author.send(message.translate("misc:RESTRICTED_CHANNEL", { channel: message.channel.toString() })); - }; + } if (customCommandAnswer) return message.channel.send({ content: customCommandAnswer }); if (cmd.conf.guildOnly && !message.guild) return message.error("misc:GUILD_ONLY"); @@ -148,7 +148,7 @@ module.exports = class { if (neededPermissions.length > 0) return message.error("misc:MISSING_MEMBER_PERMS", { list: neededPermissions.map((p) => `\`${p}\``).join(", ") }); if (!message.channel.permissionsFor(message.member).has(Permissions.FLAGS.MENTION_EVERYONE) && (message.content.includes("@everyone") || message.content.includes("@here"))) return message.error("misc:EVERYONE_MENTION"); if (!message.channel.nsfw && cmd.conf.nsfw) return message.error("misc:NSFW_COMMAND"); - }; + } if (!cmd.conf.enabled) return message.error("misc:COMMAND_DISABLED"); if (cmd.conf.ownerOnly && message.author.id !== client.config.owner.id) return message.error("misc:OWNER_ONLY"); @@ -157,13 +157,13 @@ module.exports = class { if (!uCooldown) { cmdCooldown[message.author.id] = {}; uCooldown = cmdCooldown[message.author.id]; - }; + } const time = uCooldown[cmd.help.name] || 0; if (time && (time > Date.now())) { const seconds = Math.ceil((time - Date.now()) / 1000); return message.error("misc:COOLDOWNED", { seconds: `${seconds} ${client.getNoun(seconds, message.translate("misc:NOUNS:SECONDS:1"), message.translate("misc:NOUNS:SECONDS:2"), message.translate("misc:NOUNS:SECONDS:5"))}` }); - }; + } cmdCooldown[message.author.id][cmd.help.name] = Date.now() + cmd.conf.cooldown; @@ -194,7 +194,7 @@ module.exports = class { attachment: "./assets/img/achievements/achievement_unlocked2.png" }] }); - }; + } try { cmd.run(message, args, data); @@ -202,7 +202,7 @@ module.exports = class { } catch (e) { console.error(e); return message.error("misc:ERR_OCCURRED"); - }; + } } }; @@ -219,7 +219,7 @@ async function updateXp(client, msg, data) { const isInCooldown = xpCooldown[msg.author.id]; if (isInCooldown) { if (isInCooldown > Date.now()) return; - }; + } // Records in the database the time when the member will be able to win xp again (1min) const toWait = Date.now() + 60000; @@ -239,4 +239,4 @@ async function updateXp(client, msg, data) { // Update user data data.memberData.exp = parseInt(newXp, 10); await data.memberData.save(); -}; \ No newline at end of file +} \ No newline at end of file diff --git a/events/ready.js b/events/ready.js index 4f981f81..139e1d65 100644 --- a/events/ready.js +++ b/events/ready.js @@ -1,5 +1,4 @@ -const chalk = require("chalk"), - { Permissions } = require("discord.js"); +const { Permissions } = require("discord.js"); module.exports = class { constructor(client) { diff --git a/helpers/autoUpdateDocs.js b/helpers/autoUpdateDocs.js index 3cb48a65..de6e7605 100644 --- a/helpers/autoUpdateDocs.js +++ b/helpers/autoUpdateDocs.js @@ -48,6 +48,6 @@ module.exports = { } else { fs.writeFileSync("./dashboard/public/docs/commands.md", text); client.logger.log("Dashboard docs updated!"); - }; + } } }; \ No newline at end of file diff --git a/helpers/birthdays.js b/helpers/birthdays.js index badcde0e..68f8529e 100644 --- a/helpers/birthdays.js +++ b/helpers/birthdays.js @@ -36,17 +36,17 @@ async function init(client) { .setFooter({ text: client.config.embed.footer }) .addField(client.translate("economy/birthdate:HAPPY_BIRTHDAY"), client.translate("economy/birthdate:HAPPY_BIRTHDAY_MESSAGE", { user: user.id, - age: `${age} ${client.getNoun(age, message.translate("misc:NOUNS:AGE:1"), message.translate("misc:NOUNS:AGE:2"), message.translate("misc:NOUNS:AGE:5"))}` + age: `${age} ${client.getNoun(age, client.translate("misc:NOUNS:AGE:1"), client.translate("misc:NOUNS:AGE:2"), client.translate("misc:NOUNS:AGE:5"))}` })); const msg = await channel.send({ content: "@here", embeds: [embed] }); await msg.react("🎉"); - }; - }; + } + } }); - }; - }; + } + } }); }, null, true, "Europe/Moscow"); -}; +} module.exports = { init }; \ No newline at end of file diff --git a/helpers/checkReminds.js b/helpers/checkReminds.js index 687022ba..543e173d 100644 --- a/helpers/checkReminds.js +++ b/helpers/checkReminds.js @@ -13,7 +13,7 @@ module.exports = { for (const user of users) { if (!client.users.cache.has(user.id)) client.users.fetch(user.id); client.databaseCache.usersReminds.set(user.id, user); - }; + } }); setInterval(async function () { const dateNow = Date.now(); @@ -37,8 +37,8 @@ module.exports = { user.reminds = user.reminds.filter((r) => r.sendAt >= dateNow); user.save(); if (user.reminds.length === 0) client.databaseCache.usersReminds.delete(user.id); - }; - }; + } + } }); }, 1000); } diff --git a/helpers/checkUnmutes.js b/helpers/checkUnmutes.js index d3a533d1..181b03a9 100644 --- a/helpers/checkUnmutes.js +++ b/helpers/checkUnmutes.js @@ -38,7 +38,7 @@ module.exports = { const permOverwrites = channel.permissionOverwrites.cache.get(member.id); if (permOverwrites) permOverwrites.delete(); }); - }; + } const user = member ? member.user : await client.users.fetch(memberData.id); const embed = new Discord.MessageEmbed() .setDescription(guild.translate("moderation/unmute:SUCCESS_CASE", { diff --git a/helpers/discordbots.org.js b/helpers/discordbots.org.js index ed411d63..3f7f7ae9 100644 --- a/helpers/discordbots.org.js +++ b/helpers/discordbots.org.js @@ -36,6 +36,6 @@ module.exports = { }) }); }); - }; + } } }; \ No newline at end of file diff --git a/helpers/functions.js b/helpers/functions.js index 2aa67607..f4802cce 100644 --- a/helpers/functions.js +++ b/helpers/functions.js @@ -28,7 +28,7 @@ module.exports = { return prefix; } else { return true; - }; + } }, // This function return a actual link to the support server @@ -44,7 +44,7 @@ module.exports = { return invite ? invite.url : null; } else { return ""; - }; + } }, // This function sort an array @@ -90,31 +90,31 @@ module.exports = { const d = absoluteDays ? absoluteDays === 1 ? - guild.translate("time:ONE_DAY") : - guild.translate("time:DAYS", { - amount: absoluteDays - }) : + guild.translate("time:ONE_DAY") : + guild.translate("time:DAYS", { + amount: absoluteDays + }) : null; const h = absoluteHours ? absoluteHours === 1 ? - guild.translate("time:ONE_HOUR") : - guild.translate("time:HOURS", { - amount: absoluteHours - }) : + guild.translate("time:ONE_HOUR") : + guild.translate("time:HOURS", { + amount: absoluteHours + }) : null; const m = absoluteMinutes ? absoluteMinutes === 1 ? - guild.translate("time:ONE_MINUTE") : - guild.translate("time:MINUTES", { - amount: absoluteMinutes - }) : + guild.translate("time:ONE_MINUTE") : + guild.translate("time:MINUTES", { + amount: absoluteMinutes + }) : null; const s = absoluteSeconds ? absoluteSeconds === 1 ? - guild.translate("time:ONE_SECOND") : - guild.translate("time:SECONDS", { - amount: absoluteSeconds - }) : + guild.translate("time:ONE_SECOND") : + guild.translate("time:SECONDS", { + amount: absoluteSeconds + }) : null; const absoluteTime = []; diff --git a/helpers/languages.js b/helpers/languages.js index 1b33816f..65581a7e 100644 --- a/helpers/languages.js +++ b/helpers/languages.js @@ -18,14 +18,14 @@ async function walkDirectory(dir, namespaces = [], folderName = "") { namespaces = folder.namespaces; } else { namespaces.push(`${folderName}${file.substr(0, file.length - 5)}`); - }; - }; + } + } return { namespaces: [...new Set(namespaces)], languages }; -}; +} module.exports = async () => { const options = { diff --git a/helpers/logger.js b/helpers/logger.js index 89e8a230..e4761433 100644 --- a/helpers/logger.js +++ b/helpers/logger.js @@ -8,7 +8,7 @@ function dateTimePad(value, digits) { while (number.toString().length < digits) number = "0" + number; return number; -}; +} function format(tDate) { return (tDate.getFullYear() + "-" + @@ -18,7 +18,7 @@ function format(tDate) { dateTimePad(tDate.getMinutes(), 2) + ":" + dateTimePad(tDate.getSeconds(), 2) + "." + dateTimePad(tDate.getMilliseconds(), 3)); -}; +} module.exports = class Logger { static log(content, type = "log") { @@ -27,30 +27,30 @@ module.exports = class Logger { // Check the message type and then print him in the console case "log": { return console.log(`${date} ${bgBlue(type.toUpperCase())} ${content} `); - }; + } - case "warn": { - return console.log(`${date} ${black.bgYellow(type.toUpperCase())} ${content} `); - }; + case "warn": { + return console.log(`${date} ${black.bgYellow(type.toUpperCase())} ${content} `); + } - case "error": { - return console.log(`${date} ${black.bgRed(type.toUpperCase())} ${content} `); - }; + case "error": { + return console.log(`${date} ${black.bgRed(type.toUpperCase())} ${content} `); + } - case "debug": { - return console.log(`${date} ${green(type.toUpperCase())} ${content} `); - }; + case "debug": { + return console.log(`${date} ${green(type.toUpperCase())} ${content} `); + } - case "cmd": { - return console.log(`${date} ${black.bgWhite(type.toUpperCase())} ${content}`); - }; + case "cmd": { + return console.log(`${date} ${black.bgWhite(type.toUpperCase())} ${content}`); + } - case "ready": { - return console.log(`${date} ${black.bgGreen(type.toUpperCase())} ${content}`); - }; + case "ready": { + return console.log(`${date} ${black.bgGreen(type.toUpperCase())} ${content}`); + } - default: - throw new TypeError("Logger type must be either warn, debug, log, ready, cmd or error."); - }; + default: + throw new TypeError("Logger type must be either warn, debug, log, ready, cmd or error."); + } } }; \ No newline at end of file diff --git a/helpers/resolvers.js b/helpers/resolvers.js index e826134e..a45dced8 100644 --- a/helpers/resolvers.js +++ b/helpers/resolvers.js @@ -7,19 +7,19 @@ const resolveChannel = async ({ message, search, channelType }) => { const [, channelId] = contentToCheck.match(/^<#([0-9]{18})>/); const channelFound = message.guild.channels.cache.get(channelId); if (channelFound && channelType && channelFound.type === channelType) return channelFound; - }; + } // Try with ID if (message.guild.channels.cache.has(search)) { const channelFound = message.guild.channels.cache.get(search); if (channelFound && channelType && channelFound.type === channelType) return channelFound; - }; + } // Try with name with # if (message.guild.channels.cache.some(channel => `#${channel.name}` === search || channel.name === search)) { const channelFound = message.guild.channels.cache.find(channel => `#${channel.name}` === search || channel.name === search); if (channelFound && channelType && channelFound.type === channelType) return channelFound; - }; + } return; }; @@ -33,13 +33,13 @@ const resolveMember = async ({ message, search, useMessageContent = true }) => { const [, userId] = contentToCheck.match(/^<@!?(\d+)>$/); const memberFound = await message.guild.members.fetch(userId).catch(() => {}); if (memberFound) return memberFound; - }; + } // Try with ID if (await message.guild.members.fetch(search).catch(() => {})) { const memberFound = await message.guild.members.fetch(search); if (memberFound) return memberFound; - }; + } // Try with name with @ await message.guild.members.fetch({ @@ -49,7 +49,7 @@ const resolveMember = async ({ message, search, useMessageContent = true }) => { if (message.guild.members.cache.some(member => member.user.tag === search || member.user.username === search)) { const memberFound = message.guild.members.cache.find(member => member.user.tag === search || member.user.username === search); if (memberFound) return memberFound; - }; + } return; }; @@ -64,19 +64,19 @@ const resolveRole = async ({ message, search }) => { const roleFound = message.guild.roles.cache.get(roleId); if (roleFound) return roleFound; - }; + } // Try with ID if (message.guild.roles.cache.has(search)) { const roleFound = message.guild.roles.cache.get(search); if (roleFound) return roleFound; - }; + } // Try with name with @ if (message.guild.roles.cache.some(role => `@${role.name}` === search || role.name === search)) { const roleFound = message.guild.roles.cache.find(role => `@${role.name}` === search || role.name === search); if (roleFound) return roleFound; - }; + } return; }; diff --git a/index.js b/index.js index a29e62f4..21a83b98 100644 --- a/index.js +++ b/index.js @@ -17,8 +17,8 @@ if (config.apiKeys.sentryDSN) { } catch (e) { console.log(e); console.log(chalk.yellow("Looks like your Sentry DSN key is invalid. If you do not intend to use Sentry, please remove the key from the configuration file.")); - }; -}; + } +} // Load JaBa class const JaBa = require("./base/JaBa"); @@ -46,9 +46,7 @@ const init = async () => { const commands = await readdir(`./commands/${dir}/`); commands.filter((cmd) => cmd.split(".").pop() === "js").forEach((cmd) => { const response = client.loadCommand(`./commands/${dir}`, cmd); - if (response) { - client.logger.log(response, "error"); - }; + if (response) client.logger.log(response, "error"); }); }); diff --git a/scripts/create-db-indexes.js b/scripts/create-db-indexes.js index a6333eab..f5e9f462 100644 --- a/scripts/create-db-indexes.js +++ b/scripts/create-db-indexes.js @@ -8,7 +8,7 @@ try { } catch (e) { console.log(chalk.red("Cannot find module mongodb. Please install it using \"npm install mongodb\" before executing script.")); process.exit(1); -}; +} const config = require("../config.js"); const dbName = config.mongoDB.split("/").pop(); diff --git a/scripts/migrate-db-from-v4.6-to-v4.7.js b/scripts/migrate-db-from-v4.6-to-v4.7.js index 90517407..3dec46a9 100644 --- a/scripts/migrate-db-from-v4.6-to-v4.7.js +++ b/scripts/migrate-db-from-v4.6-to-v4.7.js @@ -8,7 +8,7 @@ try { } catch (e) { console.log(chalk.red("Cannot find module mongodb. Please install it using \"npm install mongodb\" before executing script.")); process.exit(1); -}; +} const config = require("../config.js"); const dbName = config.mongoDB.split("/").pop(); diff --git a/scripts/verify-config.js b/scripts/verify-config.js index 58674d8c..57a67a65 100644 --- a/scripts/verify-config.js +++ b/scripts/verify-config.js @@ -17,7 +17,7 @@ const checks = [ success("node.js version equal or higher than v12"); } else { error("node.js version should be equal or higher than v12"); - }; + } res(); }); }, @@ -35,7 +35,7 @@ const checks = [ error("Should be added to the emojis server", "please add your bot on this server: https://discord.gg/5wrBEwE4bc to make the emojis working"); } else { success("Added to the emojis server"); - }; + } res(); }).catch(() => { error("Should be a valid bot token"); @@ -79,7 +79,7 @@ const checks = [ error("Should be a valid Amethyste API key", "get your key here: https://api.amethyste.moe/"); } else { success("Valid Amethyste API key"); - }; + } } if (!config.apiKeys.blagueXYZ) { ignore("blague.xyz API is not configured, key should not be checked."); @@ -94,8 +94,8 @@ const checks = [ error("Should be a valid blague.xyz key", "get your key here: https://blague.xyz/"); } else { success("Valid blague.xyz key"); - }; - }; + } + } if (!config.apiKeys.dbl) { ignore("DBL API is not configured, key should not be checked."); } else { @@ -110,8 +110,8 @@ const checks = [ error("Should be a valid DBL key", "get your key here: https://top.gg/ OR delete the key from the config if you don't have a key"); } else { success("Valid DBL key"); - }; - }; + } + } if (!config.apiKeys.sentryDSN) { ignore("SentryDSN is not configured, key should not be checked."); } else { @@ -124,8 +124,8 @@ const checks = [ success("should be a valid Sentry DSN key"); } catch (e) { error("valid Sentry DSN key", "Sentry is not recommended, delete the key from the config"); - }; - }; + } + } resolve(); }); }, @@ -157,8 +157,8 @@ const checks = [ error("Dashboard port should be available", "you have probably another process using this port"); } else { success("Dashboard port is available"); - }; - }; + } + } resolve(); }); } @@ -168,6 +168,6 @@ const checks = [ console.log(chalk.yellow("This script will check if your config is errored, and some other important things such as whether your database is started, etc...")); for (const check of checks) { await check(); - }; + } process.exit(0); })(); \ No newline at end of file