From c3dca64be4f651e0ab0057118ed655f910a8791e Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Wed, 5 Jul 2023 00:58:06 +0500 Subject: [PATCH] prettier --- .prettierrc | 11 + base/BaseCommand.js | 4 +- base/BaseEvent.js | 2 +- base/Guild.js | 75 +-- base/JaBa.js | 47 +- base/Member.js | 26 +- base/User.js | 117 +++-- commands/!DISABLED/importmee6.js | 4 +- commands/!DISABLED/memes.js | 31 +- commands/!DISABLED/staff.js | 13 +- commands/Administration/automod.js | 40 +- commands/Administration/autorole.js | 38 +- commands/Administration/config.js | 145 +++--- commands/Administration/goodbye.js | 92 ++-- commands/Administration/selectroles.js | 122 +++-- commands/Administration/set.js | 69 +-- commands/Administration/setlang.js | 29 +- commands/Administration/stealemoji.js | 31 +- commands/Administration/welcome.js | 92 ++-- commands/Economy/achievements.js | 25 +- commands/Economy/bank.js | 55 +- commands/Economy/birthdate.js | 87 ++-- commands/Economy/divorce.js | 8 +- commands/Economy/leaderboard.js | 80 +-- commands/Economy/marry.js | 62 +-- commands/Economy/money.js | 26 +- commands/Economy/pay.js | 47 +- commands/Economy/profile.js | 47 +- commands/Economy/rep.js | 42 +- commands/Economy/rob.js | 51 +- commands/Economy/setbio.js | 23 +- commands/Economy/slots.js | 122 +++-- commands/Economy/transactions.js | 59 ++- commands/Economy/work.js | 36 +- commands/Fun/8ball.js | 23 +- commands/Fun/cat.js | 6 +- commands/Fun/crab.js | 6 +- commands/Fun/dog.js | 6 +- commands/Fun/lmgtfy.js | 40 +- commands/Fun/lovecalc.js | 38 +- commands/Fun/number.js | 22 +- commands/Fun/tictactoe.js | 23 +- commands/General/afk.js | 23 +- commands/General/avatar.js | 44 +- commands/General/boosters.js | 40 +- commands/General/emoji.js | 23 +- commands/General/help.js | 53 +- commands/General/minecraft.js | 36 +- commands/General/ping.js | 14 +- commands/General/remindme.js | 40 +- commands/General/report.js | 40 +- commands/General/serverinfo.js | 46 +- commands/General/shorturl.js | 23 +- commands/General/stats.js | 15 +- commands/General/suggest.js | 23 +- commands/General/userinfo.js | 39 +- commands/General/whois.js | 31 +- commands/IAT/checkjar.js | 8 +- commands/Moderation/clear.js | 77 +-- commands/Moderation/clearwarns.js | 23 +- commands/Moderation/giveaway.js | 257 ++++++---- commands/Moderation/poll.js | 51 +- commands/Moderation/unban.js | 23 +- commands/Moderation/warn.js | 61 ++- commands/Moderation/warns.js | 37 +- commands/Music/back.js | 6 +- commands/Music/clips.js | 29 +- commands/Music/loop.js | 45 +- commands/Music/nowplaying.js | 16 +- commands/Music/play.js | 31 +- commands/Music/queue.js | 75 ++- commands/Music/seek.js | 23 +- commands/Music/shuffle.js | 6 +- commands/Music/skip.js | 6 +- commands/Music/skipto.js | 23 +- commands/Music/stop.js | 6 +- commands/Music/volume.js | 29 +- commands/NSFW/nsfw.js | 26 +- commands/Owner/debug.js | 157 +++--- commands/Owner/eval.js | 51 +- commands/Owner/reload.js | 40 +- commands/Owner/say.js | 56 +- commands/Owner/servers.js | 45 +- commands/SunCountry/sendmessage.js | 121 +++-- config.sample.js | 2 +- dashboard/dashboard-core | 2 +- dashboard/dashboard.js | 4 +- events/CommandHandler.js | 14 +- events/Guild/guildBanAdd.js | 2 +- events/Guild/guildCreate.js | 16 +- events/Guild/guildDelete.js | 2 +- events/Guild/guildMemberAdd.js | 35 +- events/Guild/guildMemberRemove.js | 43 +- events/Guild/guildMemberUpdate.js | 16 +- events/MessageHandler.js | 44 +- events/Monitoring/messageUpdate.js | 3 +- events/ready.js | 4 +- helpers/autoUpdateDocs.js | 6 +- helpers/birthdays.js | 82 ++- helpers/checkReminds.js | 26 +- helpers/cleanup.js | 4 +- helpers/extenders.js | 2 +- helpers/functions.js | 18 +- helpers/languages.js | 2 +- helpers/logger.js | 24 +- helpers/mee6-api.js | 30 +- helpers/tictactoe.js | 465 +++++------------ package.json | 1 - pnpm-lock.yaml | 680 +------------------------ 109 files changed, 2403 insertions(+), 2864 deletions(-) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..219e598f --- /dev/null +++ b/.prettierrc @@ -0,0 +1,11 @@ +{ + "arrowParens": "avoid", + "bracketSpacing": true, + "endOfLine": "lf", + "printWidth": 250, + "semi": true, + "tabWidth": 4, + "trailingComma": "all", + "useTabs": true, + "parser": "babel" +} \ No newline at end of file diff --git a/base/BaseCommand.js b/base/BaseCommand.js index 7a6a2a98..0b271f77 100644 --- a/base/BaseCommand.js +++ b/base/BaseCommand.js @@ -19,8 +19,8 @@ class BaseCommand { /** * @type {String} */ - this.category = (this.dirname ? this.dirname.split(path.sep)[parseInt(this.dirname.split(path.sep).length - 1, 10)] : "Other"); + this.category = this.dirname ? this.dirname.split(path.sep)[parseInt(this.dirname.split(path.sep).length - 1, 10)] : "Other"; } } -module.exports = BaseCommand; \ No newline at end of file +module.exports = BaseCommand; diff --git a/base/BaseEvent.js b/base/BaseEvent.js index ae92c541..bd69c478 100644 --- a/base/BaseEvent.js +++ b/base/BaseEvent.js @@ -11,4 +11,4 @@ class BaseEvent { } } -module.exports = BaseEvent; \ No newline at end of file +module.exports = BaseEvent; diff --git a/base/Guild.js b/base/Guild.js index 3fb5f368..4c585c78 100644 --- a/base/Guild.js +++ b/base/Guild.js @@ -9,40 +9,43 @@ module.exports = mongoose.model("Guild", new Schema({ members: [{ type: Schema.Types.ObjectId, ref: "Member" }], language: { type: String, default: languages.find(l => l.default).name }, - plugins: { type: Object, default: { - welcome: { - enabled: false, - message: null, - channel: null, - withImage: null, + plugins: { + type: Object, + default: { + welcome: { + enabled: false, + message: null, + channel: null, + withImage: null, + }, + goodbye: { + enabled: false, + message: null, + channel: null, + withImage: null, + }, + autorole: { + enabled: false, + role: null, + }, + automod: { + enabled: false, + ignored: [], + }, + warnsSanctions: { + kick: null, + ban: null, + }, + monitoring: { + memberAdd: null, + memberLeave: null, + memberUpdate: null, + messageUpdate: null, + }, + suggestions: null, + reports: null, + birthdays: null, + modlogs: null, }, - goodbye: { - enabled: false, - message: null, - channel: null, - withImage: null, - }, - autorole: { - enabled: false, - role: null, - }, - automod: { - enabled: false, - ignored: [], - }, - warnsSanctions: { - kick: null, - ban: null, - }, - monitoring: { - memberAdd: null, - memberLeave: null, - memberUpdate: null, - messageUpdate: null, - }, - suggestions: null, - reports: null, - birthdays: null, - modlogs: null, - } }, -})); \ No newline at end of file + }, +})); diff --git a/base/JaBa.js b/base/JaBa.js index d05a7dd7..0bb69bd9 100644 --- a/base/JaBa.js +++ b/base/JaBa.js @@ -46,7 +46,7 @@ class JaBa extends Client { else setTimeout(() => { if (m.deletable) m.delete(); - }, (5 * 60 * 1000)); // m * s * ms + }, 5 * 60 * 1000); // m * s * ms }); this.player.events.on("emptyQueue", queue => queue.metadata.channel.send(this.translate("music/play:QUEUE_ENDED", null, queue.metadata.channel.guild.data.language))); this.player.events.on("emptyChannel", queue => queue.metadata.channel.send(this.translate("music/play:STOP_EMPTY", null, queue.metadata.channel.guild.data.language))); @@ -76,14 +76,17 @@ class JaBa extends Client { async init() { this.login(this.config.token); - mongoose.connect(this.config.mongoDB, { - useNewUrlParser: true, - useUnifiedTopology: true, - }).then(() => { - this.logger.log("Connected to the Mongodb database.", "log"); - }).catch(err => { - this.logger.log(`Unable to connect to the Mongodb database. Error: ${err}`, "error"); - }); + mongoose + .connect(this.config.mongoDB, { + useNewUrlParser: true, + useUnifiedTopology: true, + }) + .then(() => { + this.logger.log("Connected to the Mongodb database.", "log"); + }) + .catch(err => { + this.logger.log(`Unable to connect to the Mongodb database. Error: ${err}`, "error"); + }); await this.player.extractors.loadDefault(); @@ -99,9 +102,7 @@ class JaBa extends Client { async loadCommands(dir) { const rest = new REST().setToken(this.config.token), filePath = path.join(__dirname, dir), - folders = (await fs.readdir(filePath)) - .map(file => path.join(filePath, file)) - .filter(async path => (await fs.lstat(path)).isDirectory()); + folders = (await fs.readdir(filePath)).map(file => path.join(filePath, file)).filter(async path => (await fs.lstat(path)).isDirectory()); const commands = []; for (let index = 0; index < folders.length; index++) { @@ -122,13 +123,13 @@ class JaBa extends Client { const aliases = []; if (command.aliases && Array.isArray(command.aliases) && command.aliases.length > 0) command.aliases.forEach(alias => { - const command_alias = (command.command instanceof SlashCommandBuilder || command.command instanceof ContextMenuCommandBuilder) ? { ...command.command.toJSON() } : { ...command.command }; + const command_alias = command.command instanceof SlashCommandBuilder || command.command instanceof ContextMenuCommandBuilder ? { ...command.command.toJSON() } : { ...command.command }; command_alias.name = alias; aliases.push(command_alias); this.commands.set(alias, command); }); - commands.push((command.command instanceof SlashCommandBuilder || command.command instanceof ContextMenuCommandBuilder) ? command.command.toJSON() : command.command, ...aliases); + commands.push(command.command instanceof SlashCommandBuilder || command.command instanceof ContextMenuCommandBuilder ? command.command.toJSON() : command.command, ...aliases); if (command.onLoad || typeof command.onLoad === "function") await command.onLoad(this); this.logger.log(`Successfully loaded "${file}" command file. (Command: ${command.command.name})`); @@ -139,17 +140,13 @@ class JaBa extends Client { try { if (this.config.production) - await rest.put( - Routes.applicationCommands(this.config.user), { - body: commands, - }, - ); + await rest.put(Routes.applicationCommands(this.config.userId), { + body: commands, + }); else - await rest.put( - Routes.applicationGuildCommands(this.config.user, this.config.support.id), { - body: commands, - }, - ); + await rest.put(Routes.applicationGuildCommands(this.config.userId, this.config.support.id), { + body: commands, + }); this.logger.log("Successfully registered application commands."); } catch (err) { @@ -319,4 +316,4 @@ class JaBa extends Client { } } -module.exports = JaBa; \ No newline at end of file +module.exports = JaBa; diff --git a/base/Member.js b/base/Member.js index b0ea25d3..d494f72c 100644 --- a/base/Member.js +++ b/base/Member.js @@ -13,15 +13,21 @@ module.exports = mongoose.model("Member", new mongoose.Schema({ registeredAt: { type: Number, default: Date.now() }, - cooldowns: { type: Object, default: { - work: 0, - rob: 0, - } }, + cooldowns: { + type: Object, + default: { + work: 0, + rob: 0, + }, + }, sanctions: { type: Array, default: [] }, - mute: { type: Object, default: { - muted: false, - case: null, - endDate: null, - } }, -})); \ No newline at end of file + mute: { + type: Object, + default: { + muted: false, + case: null, + endDate: null, + }, + }, +})); diff --git a/base/User.js b/base/User.js index 05489c50..16900a3c 100644 --- a/base/User.js +++ b/base/User.js @@ -4,8 +4,7 @@ const mongoose = require("mongoose"), const genToken = () => { let token = ""; const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwzy0123456789.-_"; - for (let i = 0; i < 32; i++) - token += characters.charAt(Math.floor(Math.random() * characters.length)); + for (let i = 0; i < 32; i++) token += characters.charAt(Math.floor(Math.random() * characters.length)); return token; }; @@ -20,61 +19,67 @@ const userSchema = new mongoose.Schema({ registeredAt: { type: Number, default: Date.now() }, - achievements: { type: Object, default: { - married: { - achieved: false, - progress: { - now: 0, - total: 1, + achievements: { + type: Object, + default: { + married: { + achieved: false, + progress: { + now: 0, + total: 1, + }, + }, + work: { + achieved: false, + progress: { + now: 0, + total: 10, + }, + }, + firstCommand: { + achieved: false, + progress: { + now: 0, + total: 1, + }, + }, + slots: { + achieved: false, + progress: { + now: 0, + total: 3, + }, + }, + tip: { + achieved: false, + progress: { + now: 0, + total: 1, + }, + }, + rep: { + achieved: false, + progress: { + now: 0, + total: 20, + }, + }, + invite: { + achieved: false, + progress: { + now: 0, + total: 1, + }, }, }, - work: { - achieved: false, - progress: { - now: 0, - total: 10, - }, - }, - firstCommand: { - achieved: false, - progress: { - now: 0, - total: 1, - }, - }, - slots: { - achieved: false, - progress: { - now: 0, - total: 3, - }, - }, - tip: { - achieved: false, - progress: { - now: 0, - total: 1, - }, - }, - rep: { - achieved: false, - progress: { - now: 0, - total: 20, - }, - }, - invite: { - achieved: false, - progress: { - now: 0, - total: 1, - }, - }, - } }, + }, - cooldowns: { type: Object, default: { - rep: 0, - } }, + cooldowns: { + type: Object, + default: { + rep: 0, + }, + }, afk: { type: String, default: null }, reminds: { type: Array, default: [] }, @@ -82,7 +87,7 @@ const userSchema = new mongoose.Schema({ apiToken: { type: String, default: genToken() }, }); -userSchema.method("getAchievements", async function() { +userSchema.method("getAchievements", async function () { const canvas = Canvas.createCanvas(1800, 250), ctx = canvas.getContext("2d"); @@ -105,4 +110,4 @@ userSchema.method("getAchievements", async function() { return canvas.toBuffer(); }); -module.exports = mongoose.model("User", userSchema); \ No newline at end of file +module.exports = mongoose.model("User", userSchema); diff --git a/commands/!DISABLED/importmee6.js b/commands/!DISABLED/importmee6.js index 4896d8e1..d84b16a2 100644 --- a/commands/!DISABLED/importmee6.js +++ b/commands/!DISABLED/importmee6.js @@ -12,7 +12,7 @@ class ImportMee6 extends BaseCommand { command: new SlashCommandBuilder() .setName("importmee6") .setDescription(client.translate("economy/importmee6:DESCRIPTION")) - .setDescriptionLocalizations({ "uk": client.translate("economy/importmee6:DESCRIPTION", null, "uk-UA") }) + .setDescriptionLocalizations({ uk: client.translate("economy/importmee6:DESCRIPTION", null, "uk-UA"), ru: client.translate("economy/importmee6:DESCRIPTION", null, "ru-RU") }) .setDMPermission(false), aliases: [], dirname: __dirname, @@ -50,4 +50,4 @@ class ImportMee6 extends BaseCommand { } } -module.exports = ImportMee6; \ No newline at end of file +module.exports = ImportMee6; diff --git a/commands/!DISABLED/memes.js b/commands/!DISABLED/memes.js index 2da362f0..4fdec159 100644 --- a/commands/!DISABLED/memes.js +++ b/commands/!DISABLED/memes.js @@ -13,8 +13,8 @@ class Memes extends BaseCommand { .setName("memes") .setDescription(client.translate("fun/memes:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("fun/memes:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("fun/memes:DESCRIPTION", null, "ru-RU"), + uk: client.translate("fun/memes:DESCRIPTION", null, "uk-UA"), + ru: client.translate("fun/memes:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false), aliases: [], @@ -39,19 +39,20 @@ class Memes extends BaseCommand { await interaction.deferReply(); const tags = ["funny", "memes", "dankmemes", "me_irl", "wholesomememes"].map(tag => - JSON.parse(JSON.stringify({ - label: tag, - value: tag, - })), + JSON.parse( + JSON.stringify({ + label: tag, + value: tag, + }), + ), ); - const row = new ActionRowBuilder() - .addComponents( - new StringSelectMenuBuilder() - .setCustomId("memes_select") - .setPlaceholder(client.translate("common:NOTHING_SELECTED")) - .addOptions(tags), - ); + const row = new ActionRowBuilder().addComponents( + new StringSelectMenuBuilder() + .setCustomId("memes_select") + .setPlaceholder(client.translate("common:NOTHING_SELECTED")) + .addOptions(tags), + ); const msg = await interaction.editReply({ content: interaction.translate("common:AVAILABLE_OPTIONS"), @@ -60,7 +61,7 @@ class Memes extends BaseCommand { }); const filter = i => i.user.id === interaction.user.id; - const collector = msg.createMessageComponentCollector({ filter, idle: (2 * 60 * 1000) }); + const collector = msg.createMessageComponentCollector({ filter, idle: 2 * 60 * 1000 }); collector.on("collect", async i => { if (i.isStringSelectMenu() && i.customId === "memes_select") { @@ -93,4 +94,4 @@ class Memes extends BaseCommand { } } -module.exports = Memes; \ No newline at end of file +module.exports = Memes; diff --git a/commands/!DISABLED/staff.js b/commands/!DISABLED/staff.js index 5eee8d12..2ac8a490 100644 --- a/commands/!DISABLED/staff.js +++ b/commands/!DISABLED/staff.js @@ -12,8 +12,8 @@ class Staff extends BaseCommand { .setName("staff") .setDescription(client.translate("general/staff:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("general/staff:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("general/staff:DESCRIPTION", null, "ru-RU"), + uk: client.translate("general/staff:DESCRIPTION", null, "uk-UA"), + ru: client.translate("general/staff:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false), aliases: [], @@ -47,11 +47,14 @@ class Staff extends BaseCommand { .addFields([ { name: interaction.translate("general/staff:ADMINS"), - value: (administrators.size > 0 ? administrators.map(a => `${a.presence ? client.customEmojis.status[a.presence.status] : client.customEmojis.status.offline} | <@${a.user.id}>`).join("\n") : interaction.translate("general/staff:NO_ADMINS")), + value: + administrators.size > 0 + ? administrators.map(a => `${a.presence ? client.customEmojis.status[a.presence.status] : client.customEmojis.status.offline} | <@${a.user.id}>`).join("\n") + : interaction.translate("general/staff:NO_ADMINS"), }, { name: interaction.translate("general/staff:MODS"), - value: (moderators.size > 0 ? moderators.map(m => `${m.presence ? client.customEmojis.status[m.presence.status] : client.customEmojis.status.offline} | <@${m.user.id}>`).join("\n") : interaction.translate("general/staff:NO_MODS")), + value: moderators.size > 0 ? moderators.map(m => `${m.presence ? client.customEmojis.status[m.presence.status] : client.customEmojis.status.offline} | <@${m.user.id}>`).join("\n") : interaction.translate("general/staff:NO_MODS"), }, ]) .setColor(client.config.embed.color) @@ -65,4 +68,4 @@ class Staff extends BaseCommand { } } -module.exports = Staff; \ No newline at end of file +module.exports = Staff; diff --git a/commands/Administration/automod.js b/commands/Administration/automod.js index 8e2ad2c5..e3e2e56a 100644 --- a/commands/Administration/automod.js +++ b/commands/Administration/automod.js @@ -12,25 +12,31 @@ class Automod extends BaseCommand { .setName("automod") .setDescription(client.translate("administration/automod:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("administration/automod:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("administration/automod:DESCRIPTION", null, "ru-RU"), + uk: client.translate("administration/automod:DESCRIPTION", null, "uk-UA"), + ru: client.translate("administration/automod:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) - .addBooleanOption(option => option.setName("state") - .setDescription(client.translate("common:STATE")) - .setDescriptionLocalizations({ - "uk": client.translate("common:STATE", null, "uk-UA"), - "ru": client.translate("common:STATE", null, "ru-RU"), - }) - .setRequired(true)) - .addChannelOption(option => option.setName("channel") - .setDescription(client.translate("common:CHANNEL")) - .setDescriptionLocalizations({ - "uk": client.translate("common:CHANNEL", null, "uk-UA"), - "ru": client.translate("common:CHANNEL", null, "ru-RU"), - }) - .addChannelTypes(ChannelType.GuildText)), + .addBooleanOption(option => + option + .setName("state") + .setDescription(client.translate("common:STATE")) + .setDescriptionLocalizations({ + uk: client.translate("common:STATE", null, "uk-UA"), + ru: client.translate("common:STATE", null, "ru-RU"), + }) + .setRequired(true), + ) + .addChannelOption(option => + option + .setName("channel") + .setDescription(client.translate("common:CHANNEL")) + .setDescriptionLocalizations({ + uk: client.translate("common:CHANNEL", null, "uk-UA"), + ru: client.translate("common:CHANNEL", null, "ru-RU"), + }) + .addChannelTypes(ChannelType.GuildText), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -85,4 +91,4 @@ class Automod extends BaseCommand { } } -module.exports = Automod; \ No newline at end of file +module.exports = Automod; diff --git a/commands/Administration/autorole.js b/commands/Administration/autorole.js index b59b40c2..298ee384 100644 --- a/commands/Administration/autorole.js +++ b/commands/Administration/autorole.js @@ -12,24 +12,30 @@ class Autorole extends BaseCommand { .setName("autorole") .setDescription(client.translate("administration/autorole:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("administration/autorole:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("administration/autorole:DESCRIPTION", null, "ru-RU"), + uk: client.translate("administration/autorole:DESCRIPTION", null, "uk-UA"), + ru: client.translate("administration/autorole:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) - .addBooleanOption(option => option.setName("state") - .setDescription(client.translate("common:STATE")) - .setDescriptionLocalizations({ - "uk": client.translate("common:STATE", null, "uk-UA"), - "ru": client.translate("common:STATE", null, "ru-RU"), - }) - .setRequired(true)) - .addRoleOption(option => option.setName("role") - .setDescription(client.translate("common:ROLE")) - .setDescriptionLocalizations({ - "uk": client.translate("common:ROLE", null, "uk-UA"), - "ru": client.translate("common:ROLE", null, "ru-RU"), - })), + .addBooleanOption(option => + option + .setName("state") + .setDescription(client.translate("common:STATE")) + .setDescriptionLocalizations({ + uk: client.translate("common:STATE", null, "uk-UA"), + ru: client.translate("common:STATE", null, "ru-RU"), + }) + .setRequired(true), + ) + .addRoleOption(option => + option + .setName("role") + .setDescription(client.translate("common:ROLE")) + .setDescriptionLocalizations({ + uk: client.translate("common:ROLE", null, "uk-UA"), + ru: client.translate("common:ROLE", null, "ru-RU"), + }), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -78,4 +84,4 @@ class Autorole extends BaseCommand { } } -module.exports = Autorole; \ No newline at end of file +module.exports = Autorole; diff --git a/commands/Administration/config.js b/commands/Administration/config.js index 46851c2e..8b360fe3 100644 --- a/commands/Administration/config.js +++ b/commands/Administration/config.js @@ -12,51 +12,64 @@ class Config extends BaseCommand { .setName("config") .setDescription(client.translate("administration/config:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("administration/config:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("administration/config:DESCRIPTION", null, "ru-RU"), + uk: client.translate("administration/config:DESCRIPTION", null, "uk-UA"), + ru: client.translate("administration/config:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) - .addSubcommand(subcommand => subcommand.setName("list") - .setDescription(client.translate("administration/config:LIST")) - .setDescriptionLocalizations({ - "uk": client.translate("administration/config:LIST", null, "uk-UA"), - "ru": client.translate("administration/config:LIST", null, "ru-RU"), - }), + .addSubcommand(subcommand => + subcommand + .setName("list") + .setDescription(client.translate("administration/config:LIST")) + .setDescriptionLocalizations({ + uk: client.translate("administration/config:LIST", null, "uk-UA"), + ru: client.translate("administration/config:LIST", null, "ru-RU"), + }), ) - .addSubcommand(subcommand => subcommand.setName("set") - .setDescription(client.translate("administration/config:SET")) - .setDescriptionLocalizations({ - "uk": client.translate("administration/config:SET", null, "uk-UA"), - "ru": client.translate("administration/config:SET", null, "ru-RU"), - }) - .addStringOption(option => option.setName("setting") - .setDescription(client.translate("administration/config:SETTING")) + .addSubcommand(subcommand => + subcommand + .setName("set") + .setDescription(client.translate("administration/config:SET")) .setDescriptionLocalizations({ - "uk": client.translate("administration/config:SETTING", null, "uk-UA"), - "ru": client.translate("administration/config:SETTING", null, "ru-RU"), + uk: client.translate("administration/config:SET", null, "uk-UA"), + ru: client.translate("administration/config:SET", null, "ru-RU"), }) - .setChoices( - { name: client.translate("administration/config:BIRTHDAYS"), value: "birthdays" }, - { name: client.translate("administration/config:MODLOGS"), value: "modlogs" }, - { name: client.translate("administration/config:REPORTS"), value: "reports" }, - { name: client.translate("administration/config:SUGGESTIONS"), value: "suggestions" }, - { name: client.translate("administration/config:MESSAGEUPDATE"), value: "monitoring.messageUpdate" }, + .addStringOption(option => + option + .setName("setting") + .setDescription(client.translate("administration/config:SETTING")) + .setDescriptionLocalizations({ + uk: client.translate("administration/config:SETTING", null, "uk-UA"), + ru: client.translate("administration/config:SETTING", null, "ru-RU"), + }) + .setChoices( + { name: client.translate("administration/config:BIRTHDAYS"), value: "birthdays" }, + { name: client.translate("administration/config:MODLOGS"), value: "modlogs" }, + { name: client.translate("administration/config:REPORTS"), value: "reports" }, + { name: client.translate("administration/config:SUGGESTIONS"), value: "suggestions" }, + { name: client.translate("administration/config:MESSAGEUPDATE"), value: "monitoring.messageUpdate" }, + ) + .setRequired(true), ) - .setRequired(true)) - .addBooleanOption(option => option.setName("state") - .setDescription(client.translate("common:STATE")) - .setDescriptionLocalizations({ - "uk": client.translate("common:STATE", null, "uk-UA"), - "ru": client.translate("common:STATE", null, "ru-RU"), - }) - .setRequired(true)) - .addChannelOption(option => option.setName("channel") - .setDescription(client.translate("common:CHANNEL")) - .setDescriptionLocalizations({ - "uk": client.translate("common:CHANNEL", null, "uk-UA"), - "ru": client.translate("common:CHANNEL", null, "ru-RU"), - })), + .addBooleanOption(option => + option + .setName("state") + .setDescription(client.translate("common:STATE")) + .setDescriptionLocalizations({ + uk: client.translate("common:STATE", null, "uk-UA"), + ru: client.translate("common:STATE", null, "ru-RU"), + }) + .setRequired(true), + ) + .addChannelOption(option => + option + .setName("channel") + .setDescription(client.translate("common:CHANNEL")) + .setDescriptionLocalizations({ + uk: client.translate("common:CHANNEL", null, "uk-UA"), + ru: client.translate("common:CHANNEL", null, "ru-RU"), + }), + ), ), aliases: [], dirname: __dirname, @@ -94,38 +107,45 @@ class Config extends BaseCommand { .addFields([ { name: interaction.translate("administration/config:WELCOME_TITLE"), - value: guildData.plugins.welcome.enabled ? interaction.translate("administration/config:WELCOME_CONTENT", { - channel: `<#${guildData.plugins.welcome.channel}>`, - withImage: guildData.plugins.welcome.withImage ? interaction.translate("common:YES") : interaction.translate("common:NO"), - }) : interaction.translate("common:DISABLED"), + value: guildData.plugins.welcome.enabled + ? interaction.translate("administration/config:WELCOME_CONTENT", { + channel: `<#${guildData.plugins.welcome.channel}>`, + withImage: guildData.plugins.welcome.withImage ? interaction.translate("common:YES") : interaction.translate("common:NO"), + }) : interaction.translate("common:DISABLED"), inline: true, }, { name: interaction.translate("administration/config:GOODBYE_TITLE"), - value: guildData.plugins.goodbye.enabled ? interaction.translate("administration/config:GOODBYE_CONTENT", { - channel: `<#${guildData.plugins.goodbye.channel}>`, - withImage: guildData.plugins.goodbye.withImage ? interaction.translate("common:YES") : interaction.translate("common:NO"), - }) : interaction.translate("common:DISABLED"), + value: guildData.plugins.goodbye.enabled + ? interaction.translate("administration/config:GOODBYE_CONTENT", { + channel: `<#${guildData.plugins.goodbye.channel}>`, + withImage: guildData.plugins.goodbye.withImage ? interaction.translate("common:YES") : interaction.translate("common:NO"), + }) : interaction.translate("common:DISABLED"), inline: true, }, { name: interaction.translate("administration/config:AUTOROLE_TITLE"), - value: guildData.plugins.autorole.enabled ? `<@&${guildData.plugins.autorole.role}>` - : interaction.translate("common:DISABLED"), + value: guildData.plugins.autorole.enabled ? `<@&${guildData.plugins.autorole.role}>` : interaction.translate("common:DISABLED"), }, { name: interaction.translate("administration/config:AUTO_SANCTIONS"), - value: (guildData.plugins.warnsSanctions.kick ? interaction.translate("administration/config:KICK_CONTENT", { - count: guildData.plugins.warnsSanctions.kick, - }) : interaction.translate("administration/config:KICK_NOT_DEFINED")) + "\n" + (guildData.plugins.warnsSanctions.ban ? interaction.translate("administration/config:BAN_CONTENT", { - count: guildData.plugins.warnsSanctions.ban, - }) : interaction.translate("administration/config:BAN_NOT_DEFINED")), + value: + (guildData.plugins.warnsSanctions.kick + ? interaction.translate("administration/config:KICK_CONTENT", { + count: guildData.plugins.warnsSanctions.kick, + }) : interaction.translate("administration/config:KICK_NOT_DEFINED")) + + "\n" + + (guildData.plugins.warnsSanctions.ban + ? interaction.translate("administration/config:BAN_CONTENT", { + count: guildData.plugins.warnsSanctions.ban, + }) : interaction.translate("administration/config:BAN_NOT_DEFINED")), }, { name: interaction.translate("administration/config:AUTOMOD_TITLE"), - value: guildData.plugins.automod.enabled ? interaction.translate("administration/config:AUTOMOD_CONTENT", { - channels: guildData.plugins.automod.ignored.map(ch => ` ${ch}`), - }) : interaction.translate("common:DISABLED"), + value: guildData.plugins.automod.enabled + ? interaction.translate("administration/config:AUTOMOD_CONTENT", { + channels: guildData.plugins.automod.ignored.map(ch => ` ${ch}`), + }) : interaction.translate("common:DISABLED"), }, { name: interaction.translate("administration/config:MONITORING_CHANNELS"), @@ -189,11 +209,14 @@ async function changeSetting(interaction, setting, state, channel, guildData) { content: `${interaction.translate(`administration/config:${setting.toUpperCase()}`)}: **${interaction.translate("common:ENABLED")}** (${channel.toString()})`, ephemeral: true, }); - } else return interaction.reply({ - content: `${interaction.translate(`administration/config:${setting.toUpperCase()}`)}: ${guildData.plugins[setting] ? `**${interaction.translate("common:ENABLED")}** (<#${guildData.plugins[setting]}>)` : `**${interaction.translate("common:DISABLED")}**`}`, - ephemeral: true, - }); + } else + return interaction.reply({ + content: `${interaction.translate(`administration/config:${setting.toUpperCase()}`)}: ${ + guildData.plugins[setting] ? `**${interaction.translate("common:ENABLED")}** (<#${guildData.plugins[setting]}>)` : `**${interaction.translate("common:DISABLED")}**` + }`, + ephemeral: true, + }); } } -module.exports = Config; \ No newline at end of file +module.exports = Config; diff --git a/commands/Administration/goodbye.js b/commands/Administration/goodbye.js index 785a0365..a2f84be9 100644 --- a/commands/Administration/goodbye.js +++ b/commands/Administration/goodbye.js @@ -12,49 +12,65 @@ class Goodbye extends BaseCommand { .setName("goodbye") .setDescription(client.translate("administration/goodbye:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("administration/goodbye:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("administration/goodbye:DESCRIPTION", null, "ru-RU"), + uk: client.translate("administration/goodbye:DESCRIPTION", null, "uk-UA"), + ru: client.translate("administration/goodbye:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) - .addSubcommand(subcommand => subcommand.setName("test") - .setDescription(client.translate("administration/goodbye:TEST")) - .setDescriptionLocalizations({ - "uk": client.translate("administration/goodbye:TEST", null, "uk-UA"), - "ru": client.translate("administration/goodbye:TEST", null, "ru-RU"), - }), + .addSubcommand(subcommand => + subcommand + .setName("test") + .setDescription(client.translate("administration/goodbye:TEST")) + .setDescriptionLocalizations({ + uk: client.translate("administration/goodbye:TEST", null, "uk-UA"), + ru: client.translate("administration/goodbye:TEST", null, "ru-RU"), + }), ) - .addSubcommand(subcommand => subcommand.setName("config") - .setDescription(client.translate("administration/goodbye:CONFIG")) - .setDescriptionLocalizations({ - "uk": client.translate("administration/goodbye:CONFIG", null, "uk-UA"), - "ru": client.translate("administration/goodbye:CONFIG", null, "ru-RU"), - }) - .addBooleanOption(option => option.setName("state") - .setDescription(client.translate("common:STATE")) + .addSubcommand(subcommand => + subcommand + .setName("config") + .setDescription(client.translate("administration/goodbye:CONFIG")) .setDescriptionLocalizations({ - "uk": client.translate("common:STATE", null, "uk-UA"), - "ru": client.translate("common:STATE", null, "ru-RU"), + uk: client.translate("administration/goodbye:CONFIG", null, "uk-UA"), + ru: client.translate("administration/goodbye:CONFIG", null, "ru-RU"), }) - .setRequired(true)) - .addChannelOption(option => option.setName("channel") - .setDescription(client.translate("common:CHANNEL")) - .setDescriptionLocalizations({ - "uk": client.translate("common:CHANNEL", null, "uk-UA"), - "ru": client.translate("common:CHANNEL", null, "ru-RU"), - })) - .addStringOption(option => option.setName("message") - .setDescription(client.translate("administration/goodbye:MESSAGE")) - .setDescriptionLocalizations({ - "uk": client.translate("administration/goodbye:MESSAGE", null, "uk-UA"), - "ru": client.translate("administration/goodbye:MESSAGE", null, "ru-RU"), - })) - .addBooleanOption(option => option.setName("image") - .setDescription(client.translate("administration/goodbye:IMAGE")) - .setDescriptionLocalizations({ - "uk": client.translate("administration/goodbye:IMAGE", null, "uk-UA"), - "ru": client.translate("administration/goodbye:IMAGE", null, "ru-RU"), - })), + .addBooleanOption(option => + option + .setName("state") + .setDescription(client.translate("common:STATE")) + .setDescriptionLocalizations({ + uk: client.translate("common:STATE", null, "uk-UA"), + ru: client.translate("common:STATE", null, "ru-RU"), + }) + .setRequired(true), + ) + .addChannelOption(option => + option + .setName("channel") + .setDescription(client.translate("common:CHANNEL")) + .setDescriptionLocalizations({ + uk: client.translate("common:CHANNEL", null, "uk-UA"), + ru: client.translate("common:CHANNEL", null, "ru-RU"), + }), + ) + .addStringOption(option => + option + .setName("message") + .setDescription(client.translate("administration/goodbye:MESSAGE")) + .setDescriptionLocalizations({ + uk: client.translate("administration/goodbye:MESSAGE", null, "uk-UA"), + ru: client.translate("administration/goodbye:MESSAGE", null, "ru-RU"), + }), + ) + .addBooleanOption(option => + option + .setName("image") + .setDescription(client.translate("administration/goodbye:IMAGE")) + .setDescriptionLocalizations({ + uk: client.translate("administration/goodbye:IMAGE", null, "uk-UA"), + ru: client.translate("administration/goodbye:IMAGE", null, "ru-RU"), + }), + ), ), aliases: [], dirname: __dirname, @@ -117,4 +133,4 @@ class Goodbye extends BaseCommand { } } -module.exports = Goodbye; \ No newline at end of file +module.exports = Goodbye; diff --git a/commands/Administration/selectroles.js b/commands/Administration/selectroles.js index d9047c94..13dd8a24 100644 --- a/commands/Administration/selectroles.js +++ b/commands/Administration/selectroles.js @@ -12,52 +12,68 @@ class Selectroles extends BaseCommand { .setName("selectroles") .setDescription(client.translate("administration/selectroles:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("administration/selectroles:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("administration/selectroles:DESCRIPTION", null, "ru-RU"), + uk: client.translate("administration/selectroles:DESCRIPTION", null, "uk-UA"), + ru: client.translate("administration/selectroles:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) - .addSubcommand(subcommand => subcommand.setName("message") - .setDescription(client.translate("administration/selectroles:MESSAGE")) - .setDescriptionLocalizations({ - "uk": client.translate("administration/selectroles:MESSAGE", null, "uk-UA"), - "ru": client.translate("administration/selectroles:MESSAGE", null, "ru-RU"), - }) - .addStringOption(option => option.setName("text") - .setDescription(client.translate("common:MESSAGE")) + .addSubcommand(subcommand => + subcommand + .setName("message") + .setDescription(client.translate("administration/selectroles:MESSAGE")) .setDescriptionLocalizations({ - "uk": client.translate("common:MESSAGE", null, "uk-UA"), - "ru": client.translate("common:MESSAGE", null, "ru-RU"), + uk: client.translate("administration/selectroles:MESSAGE", null, "uk-UA"), + ru: client.translate("administration/selectroles:MESSAGE", null, "ru-RU"), }) - .setRequired(true)), + .addStringOption(option => + option + .setName("text") + .setDescription(client.translate("common:MESSAGE")) + .setDescriptionLocalizations({ + uk: client.translate("common:MESSAGE", null, "uk-UA"), + ru: client.translate("common:MESSAGE", null, "ru-RU"), + }) + .setRequired(true), + ), ) - .addSubcommand(subcommand => subcommand.setName("addrole") - .setDescription(client.translate("administration/selectroles:ADDROLE")) - .setDescriptionLocalizations({ - "uk": client.translate("administration/selectroles:ADDROLE", null, "uk-UA"), - "ru": client.translate("administration/selectroles:ADDROLE", null, "ru-RU"), - }) - .addChannelOption(option => option.setName("channel") - .setDescription(client.translate("common:CHANNEL")) + .addSubcommand(subcommand => + subcommand + .setName("addrole") + .setDescription(client.translate("administration/selectroles:ADDROLE")) .setDescriptionLocalizations({ - "uk": client.translate("common:CHANNEL", null, "uk-UA"), - "ru": client.translate("common:CHANNEL", null, "ru-RU"), + uk: client.translate("administration/selectroles:ADDROLE", null, "uk-UA"), + ru: client.translate("administration/selectroles:ADDROLE", null, "ru-RU"), }) - .setRequired(true)) - .addStringOption(option => option.setName("message_id") - .setDescription(client.translate("common:MESSAGE_ID")) - .setDescriptionLocalizations({ - "uk": client.translate("common:MESSAGE_ID", null, "uk-UA"), - "ru": client.translate("common:MESSAGE_ID", null, "ru-RU"), - }) - .setRequired(true)) - .addRoleOption(option => option.setName("role") - .setDescription(client.translate("common:ROLE")) - .setDescriptionLocalizations({ - "uk": client.translate("common:ROLE", null, "uk-UA"), - "ru": client.translate("common:ROLE", null, "ru-RU"), - }) - .setRequired(true)), + .addChannelOption(option => + option + .setName("channel") + .setDescription(client.translate("common:CHANNEL")) + .setDescriptionLocalizations({ + uk: client.translate("common:CHANNEL", null, "uk-UA"), + ru: client.translate("common:CHANNEL", null, "ru-RU"), + }) + .setRequired(true), + ) + .addStringOption(option => + option + .setName("message_id") + .setDescription(client.translate("common:MESSAGE_ID")) + .setDescriptionLocalizations({ + uk: client.translate("common:MESSAGE_ID", null, "uk-UA"), + ru: client.translate("common:MESSAGE_ID", null, "ru-RU"), + }) + .setRequired(true), + ) + .addRoleOption(option => + option + .setName("role") + .setDescription(client.translate("common:ROLE")) + .setDescriptionLocalizations({ + uk: client.translate("common:ROLE", null, "uk-UA"), + ru: client.translate("common:ROLE", null, "ru-RU"), + }) + .setRequired(true), + ), ), aliases: [], dirname: __dirname, @@ -123,10 +139,12 @@ class Selectroles extends BaseCommand { let row = message.components[0]; if (!row) row = new ActionRowBuilder(); - const option = [{ - label: role.name, - value: role.id, - }]; + const option = [ + { + label: role.name, + value: role.id, + }, + ]; const menu = row.components[0]; if (menu) { @@ -134,22 +152,14 @@ class Selectroles extends BaseCommand { if (o.value === option[0].value) return interaction.error("administration/selectroles:ALREADY_IN_MENU"); } - row = ActionRowBuilder.from(row) - .setComponents( - StringSelectMenuBuilder.from(menu) - .setMinValues(0) - .setMaxValues(menu.options.length + 1) - .addOptions(option), - ); - } else { - row.addComponents( - new StringSelectMenuBuilder() - .setCustomId("auto_roles") + row = ActionRowBuilder.from(row).setComponents( + StringSelectMenuBuilder.from(menu) .setMinValues(0) - .setMaxValues(1) - .setPlaceholder(interaction.translate("common:AVAILABLE_OPTIONS")) + .setMaxValues(menu.options.length + 1) .addOptions(option), ); + } else { + row.addComponents(new StringSelectMenuBuilder().setCustomId("auto_roles").setMinValues(0).setMaxValues(1).setPlaceholder(interaction.translate("common:AVAILABLE_OPTIONS")).addOptions(option)); } message.edit({ @@ -166,4 +176,4 @@ class Selectroles extends BaseCommand { } } -module.exports = Selectroles; \ No newline at end of file +module.exports = Selectroles; diff --git a/commands/Administration/set.js b/commands/Administration/set.js index 89a90d2c..7f20dcb2 100644 --- a/commands/Administration/set.js +++ b/commands/Administration/set.js @@ -12,38 +12,47 @@ class Set extends BaseCommand { .setName("set") .setDescription(client.translate("administration/set:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("administration/set:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("administration/set:DESCRIPTION", null, "ru-RU"), + uk: client.translate("administration/set:DESCRIPTION", null, "uk-UA"), + ru: client.translate("administration/set:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) - .addStringOption(option => option.setName("type") - .setDescription(client.translate("owner/debug:TYPE")) - .setDescriptionLocalizations({ - "uk": client.translate("owner/debug:TYPE", null, "uk-UA"), - "ru": client.translate("owner/debug:TYPE", null, "ru-RU"), - }) - .setRequired(true) - .setChoices( - { name: client.translate("common:LEVEL"), value: "level" }, - { name: client.translate("common:XP"), value: "xp" }, - { name: client.translate("common:CREDITS"), value: "credits" }, - { name: client.translate("economy/transactions:BANK"), value: "bank" }, - )) - .addUserOption(option => option.setName("user") - .setDescription(client.translate("common:USER")) - .setDescriptionLocalizations({ - "uk": client.translate("common:USER", null, "uk-UA"), - "ru": client.translate("common:USER", null, "ru-RU"), - }) - .setRequired(true)) - .addIntegerOption(option => option.setName("int") - .setDescription(client.translate("common:INT")) - .setDescriptionLocalizations({ - "uk": client.translate("common:INT", null, "uk-UA"), - "ru": client.translate("common:INT", null, "ru-RU"), - }) - .setRequired(true)), + .addStringOption(option => + option + .setName("type") + .setDescription(client.translate("owner/debug:TYPE")) + .setDescriptionLocalizations({ + uk: client.translate("owner/debug:TYPE", null, "uk-UA"), + ru: client.translate("owner/debug:TYPE", null, "ru-RU"), + }) + .setRequired(true) + .setChoices( + { name: client.translate("common:LEVEL"), value: "level" }, + { name: client.translate("common:XP"), value: "xp" }, + { name: client.translate("common:CREDITS"), value: "credits" }, + { name: client.translate("economy/transactions:BANK"), value: "bank" }, + ), + ) + .addUserOption(option => + option + .setName("user") + .setDescription(client.translate("common:USER")) + .setDescriptionLocalizations({ + uk: client.translate("common:USER", null, "uk-UA"), + ru: client.translate("common:USER", null, "ru-RU"), + }) + .setRequired(true), + ) + .addIntegerOption(option => + option + .setName("int") + .setDescription(client.translate("common:INT")) + .setDescriptionLocalizations({ + uk: client.translate("common:INT", null, "uk-UA"), + ru: client.translate("common:INT", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -123,4 +132,4 @@ class Set extends BaseCommand { } } -module.exports = Set; \ No newline at end of file +module.exports = Set; diff --git a/commands/Administration/setlang.js b/commands/Administration/setlang.js index e6c99215..16bf6e85 100644 --- a/commands/Administration/setlang.js +++ b/commands/Administration/setlang.js @@ -12,23 +12,22 @@ class Setlang extends BaseCommand { .setName("setlang") .setDescription(client.translate("administration/setlang:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("administration/setlang:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("administration/setlang:DESCRIPTION", null, "ru-RU"), + uk: client.translate("administration/setlang:DESCRIPTION", null, "uk-UA"), + ru: client.translate("administration/setlang:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) - .addStringOption(option => option.setName("language") - .setDescription(client.translate("common:LANGUAGE")) - .setDescriptionLocalizations({ - "uk": client.translate("common:LANGUAGE", null, "uk-UA"), - "ru": client.translate("common:LANGUAGE", null, "ru-RU"), - }) - .setRequired(true) - .setChoices( - { name: "English", value: "en-US" }, - { name: "Русский", value: "ru-RU" }, - { name: "Українська", value: "uk-UA" }, - )), + .addStringOption(option => + option + .setName("language") + .setDescription(client.translate("common:LANGUAGE")) + .setDescriptionLocalizations({ + uk: client.translate("common:LANGUAGE", null, "uk-UA"), + ru: client.translate("common:LANGUAGE", null, "ru-RU"), + }) + .setRequired(true) + .setChoices({ name: "English", value: "en-US" }, { name: "Русский", value: "ru-RU" }, { name: "Українська", value: "uk-UA" }), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -61,4 +60,4 @@ class Setlang extends BaseCommand { } } -module.exports = Setlang; \ No newline at end of file +module.exports = Setlang; diff --git a/commands/Administration/stealemoji.js b/commands/Administration/stealemoji.js index 750c51a6..809589a6 100644 --- a/commands/Administration/stealemoji.js +++ b/commands/Administration/stealemoji.js @@ -12,18 +12,21 @@ class Stealemoji extends BaseCommand { .setName("stealemoji") .setDescription(client.translate("administration/stealemoji:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("administration/stealemoji:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("administration/stealemoji:DESCRIPTION", null, "ru-RU"), + uk: client.translate("administration/stealemoji:DESCRIPTION", null, "uk-UA"), + ru: client.translate("administration/stealemoji:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) - .addStringOption(option => option.setName("emoji") - .setDescription(client.translate("common:EMOJI")) - .setDescriptionLocalizations({ - "uk": client.translate("common:EMOJI", null, "uk-UA"), - "ru": client.translate("common:EMOJI", null, "ru-RU"), - }) - .setRequired(true)), + .addStringOption(option => + option + .setName("emoji") + .setDescription(client.translate("common:EMOJI")) + .setDescriptionLocalizations({ + uk: client.translate("common:EMOJI", null, "uk-UA"), + ru: client.translate("common:EMOJI", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -51,9 +54,11 @@ class Stealemoji extends BaseCommand { name: parsedEmoji.name, attachment: `https://cdn.discordapp.com/emojis/${parsedEmoji.id}.${ext}`, }) - .then(emoji => interaction.success("administration/stealemoji:SUCCESS", { - emoji: emoji.name, - }, { ephemeral: true })) + .then(emoji => + interaction.success("administration/stealemoji:SUCCESS", { + emoji: emoji.name, + }, { ephemeral: true }), + ) .catch(e => { interaction.error("administration/stealemoji:ERROR", { emoji: parsedEmoji.name, @@ -63,4 +68,4 @@ class Stealemoji extends BaseCommand { } } -module.exports = Stealemoji; \ No newline at end of file +module.exports = Stealemoji; diff --git a/commands/Administration/welcome.js b/commands/Administration/welcome.js index aab9115e..aee4a683 100644 --- a/commands/Administration/welcome.js +++ b/commands/Administration/welcome.js @@ -12,49 +12,65 @@ class Welcome extends BaseCommand { .setName("welcome") .setDescription(client.translate("administration/welcome:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("administration/welcome:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("administration/welcome:DESCRIPTION", null, "ru-RU"), + uk: client.translate("administration/welcome:DESCRIPTION", null, "uk-UA"), + ru: client.translate("administration/welcome:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageGuild) - .addSubcommand(subcommand => subcommand.setName("test") - .setDescription(client.translate("administration/goodbye:TEST")) - .setDescriptionLocalizations({ - "uk": client.translate("administration/goodbye:TEST", null, "uk-UA"), - "ru": client.translate("administration/goodbye:TEST", null, "ru-RU"), - }), + .addSubcommand(subcommand => + subcommand + .setName("test") + .setDescription(client.translate("administration/goodbye:TEST")) + .setDescriptionLocalizations({ + uk: client.translate("administration/goodbye:TEST", null, "uk-UA"), + ru: client.translate("administration/goodbye:TEST", null, "ru-RU"), + }), ) - .addSubcommand(subcommand => subcommand.setName("config") - .setDescription(client.translate("administration/goodbye:CONFIG")) - .setDescriptionLocalizations({ - "uk": client.translate("administration/goodbye:CONFIG", null, "uk-UA"), - "ru": client.translate("administration/goodbye:CONFIG", null, "ru-RU"), - }) - .addBooleanOption(option => option.setName("state") - .setDescription(client.translate("common:STATE")) + .addSubcommand(subcommand => + subcommand + .setName("config") + .setDescription(client.translate("administration/goodbye:CONFIG")) .setDescriptionLocalizations({ - "uk": client.translate("common:STATE", null, "uk-UA"), - "ru": client.translate("common:STATE", null, "ru-RU"), + uk: client.translate("administration/goodbye:CONFIG", null, "uk-UA"), + ru: client.translate("administration/goodbye:CONFIG", null, "ru-RU"), }) - .setRequired(true)) - .addChannelOption(option => option.setName("channel") - .setDescription(client.translate("common:CHANNEL")) - .setDescriptionLocalizations({ - "uk": client.translate("common:CHANNEL", null, "uk-UA"), - "ru": client.translate("common:CHANNEL", null, "ru-RU"), - })) - .addStringOption(option => option.setName("message") - .setDescription(client.translate("administration/goodbye:MESSAGE")) - .setDescriptionLocalizations({ - "uk": client.translate("administration/goodbye:MESSAGE", null, "uk-UA"), - "ru": client.translate("administration/goodbye:MESSAGE", null, "ru-RU"), - })) - .addBooleanOption(option => option.setName("image") - .setDescription(client.translate("administration/goodbye:IMAGE")) - .setDescriptionLocalizations({ - "uk": client.translate("administration/goodbye:IMAGE", null, "uk-UA"), - "ru": client.translate("administration/goodbye:IMAGE", null, "ru-RU"), - })), + .addBooleanOption(option => + option + .setName("state") + .setDescription(client.translate("common:STATE")) + .setDescriptionLocalizations({ + uk: client.translate("common:STATE", null, "uk-UA"), + ru: client.translate("common:STATE", null, "ru-RU"), + }) + .setRequired(true), + ) + .addChannelOption(option => + option + .setName("channel") + .setDescription(client.translate("common:CHANNEL")) + .setDescriptionLocalizations({ + uk: client.translate("common:CHANNEL", null, "uk-UA"), + ru: client.translate("common:CHANNEL", null, "ru-RU"), + }), + ) + .addStringOption(option => + option + .setName("message") + .setDescription(client.translate("administration/goodbye:MESSAGE")) + .setDescriptionLocalizations({ + uk: client.translate("administration/goodbye:MESSAGE", null, "uk-UA"), + ru: client.translate("administration/goodbye:MESSAGE", null, "ru-RU"), + }), + ) + .addBooleanOption(option => + option + .setName("image") + .setDescription(client.translate("administration/goodbye:IMAGE")) + .setDescriptionLocalizations({ + uk: client.translate("administration/goodbye:IMAGE", null, "uk-UA"), + ru: client.translate("administration/goodbye:IMAGE", null, "ru-RU"), + }), + ), ), aliases: [], dirname: __dirname, @@ -117,4 +133,4 @@ class Welcome extends BaseCommand { } } -module.exports = Welcome; \ No newline at end of file +module.exports = Welcome; diff --git a/commands/Economy/achievements.js b/commands/Economy/achievements.js index 8317c783..7e08c016 100644 --- a/commands/Economy/achievements.js +++ b/commands/Economy/achievements.js @@ -12,16 +12,19 @@ class Achievements extends BaseCommand { .setName("achievements") .setDescription(client.translate("economy/achievements:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("economy/achievements:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("economy/achievements:DESCRIPTION", null, "ru-RU"), + uk: client.translate("economy/achievements:DESCRIPTION", null, "uk-UA"), + ru: client.translate("economy/achievements:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addUserOption(option => option.setName("user") - .setDescription(client.translate("common:USER")) - .setDescriptionLocalizations({ - "uk": client.translate("common:USER", null, "uk-UA"), - "ru": client.translate("common:USER", null, "ru-RU"), - })), + .addUserOption(option => + option + .setName("user") + .setDescription(client.translate("common:USER")) + .setDescriptionLocalizations({ + uk: client.translate("common:USER", null, "uk-UA"), + ru: client.translate("common:USER", null, "ru-RU"), + }), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -44,9 +47,7 @@ class Achievements extends BaseCommand { const user = interaction.options.getUser("user") || interaction.member; if (user.bot) return interaction.error("economy/profile:BOT_USER"); - const userData = (user.id === interaction.user.id ? data.userData : await client.findOrCreateUser({ - id: user.id, - })); + const userData = user.id === interaction.user.id ? data.userData : await client.findOrCreateUser({ id: user.id }); const embed = new EmbedBuilder() .setAuthor({ @@ -122,4 +123,4 @@ class Achievements extends BaseCommand { } } -module.exports = Achievements; \ No newline at end of file +module.exports = Achievements; diff --git a/commands/Economy/bank.js b/commands/Economy/bank.js index 589023e7..595b5f2a 100644 --- a/commands/Economy/bank.js +++ b/commands/Economy/bank.js @@ -12,28 +12,31 @@ class Bank extends BaseCommand { .setName("bank") .setDescription(client.translate("economy/bank:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("economy/bank:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("economy/bank:DESCRIPTION", null, "ru-RU"), + uk: client.translate("economy/bank:DESCRIPTION", null, "uk-UA"), + ru: client.translate("economy/bank:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addStringOption(option => option.setName("option") - .setDescription(client.translate("economy/bank:OPTION")) - .setDescriptionLocalizations({ - "uk": client.translate("economy/bank:OPTION", null, "uk-UA"), - "ru": client.translate("economy/bank:OPTION", null, "ru-RU"), - }) - .setRequired(true) - .setChoices( - { name: client.translate("economy/bank:DEPOSIT"), value: "deposit" }, - { name: client.translate("economy/bank:WITHDRAW"), value: "withdraw" }, - )) - .addStringOption(option => option.setName("credits") - .setDescription(client.translate("misc:OPTION_NAN_ALL")) - .setDescriptionLocalizations({ - "uk": client.translate("misc:OPTION_NAN_ALL", null, "uk-UA"), - "ru": client.translate("misc:OPTION_NAN_ALL", null, "ru-RU"), - }) - .setRequired(true)), + .addStringOption(option => + option + .setName("option") + .setDescription(client.translate("economy/bank:OPTION")) + .setDescriptionLocalizations({ + uk: client.translate("economy/bank:OPTION", null, "uk-UA"), + ru: client.translate("economy/bank:OPTION", null, "ru-RU"), + }) + .setRequired(true) + .setChoices({ name: client.translate("economy/bank:DEPOSIT"), value: "deposit" }, { name: client.translate("economy/bank:WITHDRAW"), value: "withdraw" }), + ) + .addStringOption(option => + option + .setName("credits") + .setDescription(client.translate("misc:OPTION_NAN_ALL")) + .setDescriptionLocalizations({ + uk: client.translate("misc:OPTION_NAN_ALL", null, "uk-UA"), + ru: client.translate("misc:OPTION_NAN_ALL", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -58,7 +61,10 @@ class Bank extends BaseCommand { if (choice === "deposit") { const credits = interaction.options.getString("credits").toLowerCase() === "all" ? data.memberData.money : interaction.options.getString("credits"); if (isNaN(credits) || credits < 1) return interaction.error("misc:OPTION_NAN_ALL"); - if (data.memberData.money < credits) return interaction.error("economy/bank:NOT_ENOUGH_CREDIT", { money: `**${credits}** ${client.functions.getNoun(credits, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}` }); + if (data.memberData.money < credits) + return interaction.error("economy/bank:NOT_ENOUGH_CREDIT", { + money: `**${credits}** ${client.functions.getNoun(credits, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`, + }); data.memberData.money -= credits; data.memberData.bankSold += credits; @@ -80,7 +86,10 @@ class Bank extends BaseCommand { } else { const credits = interaction.options.getString("credits") === "all" ? data.memberData.bankSold : interaction.options.getString("credits"); if (isNaN(credits) || credits < 1) return interaction.error("misc:OPTION_NAN_ALL"); - if (data.memberData.bankSold < credits) return interaction.error("economy/bank:NOT_ENOUGH_BANK", { money: `**${credits}** ${client.functions.getNoun(credits, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}` }); + if (data.memberData.bankSold < credits) + return interaction.error("economy/bank:NOT_ENOUGH_BANK", { + money: `**${credits}** ${client.functions.getNoun(credits, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`, + }); const info = { user: interaction.translate("economy/transactions:BANK"), @@ -104,4 +113,4 @@ class Bank extends BaseCommand { } } -module.exports = Bank; \ No newline at end of file +module.exports = Bank; diff --git a/commands/Economy/birthdate.js b/commands/Economy/birthdate.js index 74197d07..a548c3ef 100644 --- a/commands/Economy/birthdate.js +++ b/commands/Economy/birthdate.js @@ -12,45 +12,54 @@ class Birthdate extends BaseCommand { .setName("birthdate") .setDescription(client.translate("economy/birthdate:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("economy/birthdate:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("economy/birthdate:DESCRIPTION", null, "ru-RU"), + uk: client.translate("economy/birthdate:DESCRIPTION", null, "uk-UA"), + ru: client.translate("economy/birthdate:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addIntegerOption(option => option.setName("day") - .setDescription(client.translate("economy/birthdate:DAY")) - .setDescriptionLocalizations({ - "uk": client.translate("economy/birthdate:DAY", null, "uk-UA"), - "ru": client.translate("economy/birthdate:DAY", null, "ru-RU"), - }) - .setRequired(true)) - .addIntegerOption(option => option.setName("month") - .setDescription(client.translate("economy/birthdate:MONTH")) - .setDescriptionLocalizations({ - "uk": client.translate("economy/birthdate:MONTH", null, "uk-UA"), - "ru": client.translate("economy/birthdate:MONTH", null, "ru-RU"), - }) - .setRequired(true) - .setChoices( - { name: client.translate("economy/birthdate:JANUARY"), value: 1 }, - { name: client.translate("economy/birthdate:FEBRUARY"), value: 2 }, - { name: client.translate("economy/birthdate:MARCH"), value: 3 }, - { name: client.translate("economy/birthdate:APRIL"), value: 4 }, - { name: client.translate("economy/birthdate:MAY"), value: 5 }, - { name: client.translate("economy/birthdate:JUNE"), value: 6 }, - { name: client.translate("economy/birthdate:JULY"), value: 7 }, - { name: client.translate("economy/birthdate:AUGUST"), value: 8 }, - { name: client.translate("economy/birthdate:SEPTEMBER"), value: 9 }, - { name: client.translate("economy/birthdate:OCTOBER"), value: 10 }, - { name: client.translate("economy/birthdate:NOVEMBER"), value: 11 }, - { name: client.translate("economy/birthdate:DECEMBER"), value: 12 }, - )) - .addIntegerOption(option => option.setName("year") - .setDescription(client.translate("economy/birthdate:YEAR")) - .setDescriptionLocalizations({ - "uk": client.translate("economy/birthdate:YEAR", null, "uk-UA"), - "ru": client.translate("economy/birthdate:YEAR", null, "ru-RU"), - }) - .setRequired(true)), + .addIntegerOption(option => + option + .setName("day") + .setDescription(client.translate("economy/birthdate:DAY")) + .setDescriptionLocalizations({ + uk: client.translate("economy/birthdate:DAY", null, "uk-UA"), + ru: client.translate("economy/birthdate:DAY", null, "ru-RU"), + }) + .setRequired(true), + ) + .addIntegerOption(option => + option + .setName("month") + .setDescription(client.translate("economy/birthdate:MONTH")) + .setDescriptionLocalizations({ + uk: client.translate("economy/birthdate:MONTH", null, "uk-UA"), + ru: client.translate("economy/birthdate:MONTH", null, "ru-RU"), + }) + .setRequired(true) + .setChoices( + { name: client.translate("economy/birthdate:JANUARY"), value: 1 }, + { name: client.translate("economy/birthdate:FEBRUARY"), value: 2 }, + { name: client.translate("economy/birthdate:MARCH"), value: 3 }, + { name: client.translate("economy/birthdate:APRIL"), value: 4 }, + { name: client.translate("economy/birthdate:MAY"), value: 5 }, + { name: client.translate("economy/birthdate:JUNE"), value: 6 }, + { name: client.translate("economy/birthdate:JULY"), value: 7 }, + { name: client.translate("economy/birthdate:AUGUST"), value: 8 }, + { name: client.translate("economy/birthdate:SEPTEMBER"), value: 9 }, + { name: client.translate("economy/birthdate:OCTOBER"), value: 10 }, + { name: client.translate("economy/birthdate:NOVEMBER"), value: 11 }, + { name: client.translate("economy/birthdate:DECEMBER"), value: 12 }, + ), + ) + .addIntegerOption(option => + option + .setName("year") + .setDescription(client.translate("economy/birthdate:YEAR")) + .setDescriptionLocalizations({ + uk: client.translate("economy/birthdate:YEAR", null, "uk-UA"), + ru: client.translate("economy/birthdate:YEAR", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -77,7 +86,7 @@ class Birthdate extends BaseCommand { if (!(day == d.getDate() && month - 1 == d.getMonth() && year == d.getFullYear())) return interaction.error("economy/birthdate:INVALID_DATE"); if (d.getTime() > Date.now()) return interaction.error("economy/birthdate:DATE_TOO_HIGH"); - if (d.getTime() < (Date.now() - 2.523e+12)) return interaction.error("economy/birthdate:DATE_TOO_LOW"); + if (d.getTime() < Date.now() - 2.523e12) return interaction.error("economy/birthdate:DATE_TOO_LOW"); data.userData.birthdate = d; data.userData.markModified("birthdate"); @@ -89,4 +98,4 @@ class Birthdate extends BaseCommand { } } -module.exports = Birthdate; \ No newline at end of file +module.exports = Birthdate; diff --git a/commands/Economy/divorce.js b/commands/Economy/divorce.js index 4b8445b1..bd41dbf0 100644 --- a/commands/Economy/divorce.js +++ b/commands/Economy/divorce.js @@ -12,8 +12,8 @@ class Divorce extends BaseCommand { .setName("divorce") .setDescription(client.translate("economy/divorce:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("economy/divorce:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("economy/divorce:DESCRIPTION", null, "ru-RU"), + uk: client.translate("economy/divorce:DESCRIPTION", null, "uk-UA"), + ru: client.translate("economy/divorce:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false), aliases: [], @@ -36,7 +36,7 @@ class Divorce extends BaseCommand { */ async execute(client, interaction, data) { if (!data.userData.lover) return interaction.error("economy/divorce:NOT_MARRIED"); - const user = client.users.cache.get(data.userData.lover) || await client.users.fetch(data.userData.lover); + const user = client.users.cache.get(data.userData.lover) || (await client.users.fetch(data.userData.lover)); data.userData.lover = null; data.user.markModified("lover"); @@ -61,4 +61,4 @@ class Divorce extends BaseCommand { } } -module.exports = Divorce; \ No newline at end of file +module.exports = Divorce; diff --git a/commands/Economy/leaderboard.js b/commands/Economy/leaderboard.js index a261ae65..a9b068e7 100644 --- a/commands/Economy/leaderboard.js +++ b/commands/Economy/leaderboard.js @@ -12,22 +12,21 @@ class Leaderboard extends BaseCommand { .setName("leaderboard") .setDescription(client.translate("economy/leaderboard:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("economy/leaderboard:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("economy/leaderboard:DESCRIPTION", null, "ru-RU"), + uk: client.translate("economy/leaderboard:DESCRIPTION", null, "uk-UA"), + ru: client.translate("economy/leaderboard:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addStringOption(option => option.setName("type") - .setDescription(client.translate("owner/debug:TYPE")) - .setDescriptionLocalizations({ - "uk": client.translate("owner/debug:TYPE", null, "uk-UA"), - "ru": client.translate("owner/debug:TYPE", null, "ru-RU"), - }) - .setRequired(true) - .setChoices( - { name: client.translate("common:LEVEL"), value: "level" }, - { name: client.translate("common:MONEY"), value: "money" }, - { name: client.translate("common:REP"), value: "rep" }, - )), + .addStringOption(option => + option + .setName("type") + .setDescription(client.translate("owner/debug:TYPE")) + .setDescriptionLocalizations({ + uk: client.translate("owner/debug:TYPE", null, "uk-UA"), + ru: client.translate("owner/debug:TYPE", null, "ru-RU"), + }) + .setRequired(true) + .setChoices({ name: client.translate("common:LEVEL"), value: "level" }, { name: client.translate("common:MONEY"), value: "money" }, { name: client.translate("common:REP"), value: "rep" }), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -51,10 +50,11 @@ class Leaderboard extends BaseCommand { const type = interaction.options.getString("type"); const isOnMobile = JSON.stringify(Object.keys(interaction.member.presence.clientStatus)) === JSON.stringify(["mobile"]); - if (isOnMobile) interaction.followUp({ - content: interaction.translate("economy/leaderboard:MOBILE"), - ephemeral: true, - }); + if (isOnMobile) + interaction.followUp({ + content: interaction.translate("economy/leaderboard:MOBILE"), + ephemeral: true, + }); if (type === "money") { const membersLeaderboard = [], @@ -86,15 +86,18 @@ class Leaderboard extends BaseCommand { iconURL: interaction.guild.iconURL(), }) .setColor(client.config.embed.color) - .addFields({ - name: interaction.translate("common:USER"), - value: userNames, - inline: true, - }, { - name: interaction.translate("common:CREDITS"), - value: money, - inline: true, - }); + .addFields( + { + name: interaction.translate("common:USER"), + value: userNames, + inline: true, + }, + { + name: interaction.translate("common:CREDITS"), + value: money, + inline: true, + }, + ); interaction.editReply({ embeds: [embed], @@ -183,15 +186,18 @@ class Leaderboard extends BaseCommand { iconURL: interaction.guild.iconURL(), }) .setColor(client.config.embed.color) - .addFields({ - name: interaction.translate("common:USER"), - value: userNames, - inline: true, - }, { - name: interaction.translate("common:REP"), - value: rep, - inline: true, - }); + .addFields( + { + name: interaction.translate("common:USER"), + value: userNames, + inline: true, + }, + { + name: interaction.translate("common:REP"), + value: rep, + inline: true, + }, + ); interaction.editReply({ embeds: [embed], @@ -200,4 +206,4 @@ class Leaderboard extends BaseCommand { } } -module.exports = Leaderboard; \ No newline at end of file +module.exports = Leaderboard; diff --git a/commands/Economy/marry.js b/commands/Economy/marry.js index 6e8f9c1d..792b9a1d 100644 --- a/commands/Economy/marry.js +++ b/commands/Economy/marry.js @@ -13,17 +13,20 @@ class Marry extends BaseCommand { .setName("marry") .setDescription(client.translate("economy/marry:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("economy/marry:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("economy/marry:DESCRIPTION", null, "ru-RU"), + uk: client.translate("economy/marry:DESCRIPTION", null, "uk-UA"), + ru: client.translate("economy/marry:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addUserOption(option => option.setName("user") - .setDescription(client.translate("common:USER")) - .setDescriptionLocalizations({ - "uk": client.translate("common:USER", null, "uk-UA"), - "ru": client.translate("common:USER", null, "ru-RU"), - }) - .setRequired(true)), + .addUserOption(option => + option + .setName("user") + .setDescription(client.translate("common:USER")) + .setDescriptionLocalizations({ + uk: client.translate("common:USER", null, "uk-UA"), + ru: client.translate("common:USER", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -58,23 +61,27 @@ class Marry extends BaseCommand { const receiver = pendings[requester]; if (requester === interaction.author.id) { - const user = client.users.cache.get(receiver) || await client.users.fetch(receiver); + const user = client.users.cache.get(receiver) || (await client.users.fetch(receiver)); + return interaction.error("economy/marry:REQUEST_AUTHOR_TO_AMEMBER", { user: user.toString, }); } else if (receiver === interaction.member.id) { - const user = client.users.cache.get(requester) || await client.users.fetch(requester); + const user = client.users.cache.get(requester) || (await client.users.fetch(requester)); + return interaction.error("economy/marry:REQUEST_AMEMBER_TO_AUTHOR", { user: user.toString(), }); } else if (requester === member.id) { - const user = client.users.cache.get(receiver) || await client.users.fetch(receiver); + const user = client.users.cache.get(receiver) || (await client.users.fetch(receiver)); + return interaction.error("economy/marry:REQUEST_AMEMBER_TO_MEMBER", { firstUser: member.toString(), secondUser: user.toString(), }); } else if (receiver === member.id) { - const user = client.users.cache.get(requester) || await client.users.fetch(requester); + const user = client.users.cache.get(requester) || (await client.users.fetch(requester)); + return interaction.error("economy/marry:REQUEST_MEMBER_TO_AMEMBER", { firstUser: member.toString(), secondUser: user.toString(), @@ -84,17 +91,10 @@ class Marry extends BaseCommand { pendings[interaction.member.id] = member.id; - const row = new ActionRowBuilder() - .addComponents( - new ButtonBuilder() - .setCustomId("marry_confirm_yes") - .setLabel(interaction.translate("common:ACCEPT")) - .setStyle(ButtonStyle.Success), - new ButtonBuilder() - .setCustomId("marry_confirm_no") - .setLabel(interaction.translate("common:CANCEL")) - .setStyle(ButtonStyle.Danger), - ); + const row = new ActionRowBuilder().addComponents( + new ButtonBuilder().setCustomId("marry_confirm_yes").setLabel(interaction.translate("common:ACCEPT")).setStyle(ButtonStyle.Success), + new ButtonBuilder().setCustomId("marry_confirm_no").setLabel(interaction.translate("common:CANCEL")).setStyle(ButtonStyle.Danger), + ); await interaction.reply({ content: interaction.translate("economy/marry:REQUEST", { @@ -105,7 +105,7 @@ class Marry extends BaseCommand { }); const filter = i => i.user.id === member.id; - const collector = interaction.channel.createMessageComponentCollector({ filter, idle: (10 * 60 * 1000) }); + const collector = interaction.channel.createMessageComponentCollector({ filter, idle: 10 * 60 * 1000 }); collector.on("collect", async i => { if (i.isButton()) { @@ -137,10 +137,12 @@ class Marry extends BaseCommand { const messageOptions = { content: `${member.toString()} :heart: ${interaction.member.toString()}`, - files: [{ - name: "achievement_unlocked3.png", - attachment: "./assets/img/achievements/achievement_unlocked3.png", - }], + files: [ + { + name: "achievement_unlocked3.png", + attachment: "./assets/img/achievements/achievement_unlocked3.png", + }, + ], }; let sent = false; @@ -181,4 +183,4 @@ class Marry extends BaseCommand { } } -module.exports = Marry; \ No newline at end of file +module.exports = Marry; diff --git a/commands/Economy/money.js b/commands/Economy/money.js index 7d9b800e..29117778 100644 --- a/commands/Economy/money.js +++ b/commands/Economy/money.js @@ -12,16 +12,19 @@ class Money extends BaseCommand { .setName("money") .setDescription(client.translate("economy/money:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("economy/money:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("economy/money:DESCRIPTION", null, "ru-RU"), + uk: client.translate("economy/money:DESCRIPTION", null, "uk-UA"), + ru: client.translate("economy/money:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addUserOption(option => option.setName("user") - .setDescription(client.translate("common:USER")) - .setDescriptionLocalizations({ - "uk": client.translate("common:USER", null, "uk-UA"), - "ru": client.translate("common:USER", null, "ru-RU"), - })), + .addUserOption(option => + option + .setName("user") + .setDescription(client.translate("common:USER")) + .setDescriptionLocalizations({ + uk: client.translate("common:USER", null, "uk-UA"), + ru: client.translate("common:USER", null, "ru-RU"), + }), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -46,10 +49,7 @@ class Money extends BaseCommand { const member = interaction.options.getMember("user") || interaction.member; if (member.user.bot) return interaction.error("economy/money:BOT_USER"); - const memberData = member.id === interaction.user.id ? data.memberData : await client.findOrCreateMember({ - id: member.id, - guildId: interaction.guildId, - }); + const memberData = member.id === interaction.user.id ? data.memberData : await client.findOrCreateMember({ id: member.id, guildId: interaction.guildId }); const guilds = client.guilds.cache.filter(g => g.members.cache.find(m => m.id === member.id)); let globalMoney = 0; @@ -95,4 +95,4 @@ class Money extends BaseCommand { } } -module.exports = Money; \ No newline at end of file +module.exports = Money; diff --git a/commands/Economy/pay.js b/commands/Economy/pay.js index a261cf31..c038ae12 100644 --- a/commands/Economy/pay.js +++ b/commands/Economy/pay.js @@ -12,24 +12,30 @@ class Pay extends BaseCommand { .setName("pay") .setDescription(client.translate("economy/pay:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("economy/pay:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("economy/pay:DESCRIPTION", null, "ru-RU"), + uk: client.translate("economy/pay:DESCRIPTION", null, "uk-UA"), + ru: client.translate("economy/pay:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addUserOption(option => option.setName("user") - .setDescription(client.translate("common:USER")) - .setDescriptionLocalizations({ - "uk": client.translate("common:USER", null, "uk-UA"), - "ru": client.translate("common:USER", null, "ru-RU"), - }) - .setRequired(true)) - .addIntegerOption(option => option.setName("amount") - .setDescription(client.translate("common:INT")) - .setDescriptionLocalizations({ - "uk": client.translate("common:INT", null, "uk-UA"), - "ru": client.translate("common:INT", null, "ru-RU"), - }) - .setRequired(true)), + .addUserOption(option => + option + .setName("user") + .setDescription(client.translate("common:USER")) + .setDescriptionLocalizations({ + uk: client.translate("common:USER", null, "uk-UA"), + ru: client.translate("common:USER", null, "ru-RU"), + }) + .setRequired(true), + ) + .addIntegerOption(option => + option + .setName("amount") + .setDescription(client.translate("common:INT")) + .setDescriptionLocalizations({ + uk: client.translate("common:INT", null, "uk-UA"), + ru: client.translate("common:INT", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -55,9 +61,10 @@ class Pay extends BaseCommand { const amount = interaction.options.getInteger("amount"); if (amount <= 0) return interaction.error("misc:MORE_THAN_ZERO"); - if (amount > data.memberData.money) return interaction.error("economy/pay:ENOUGH_MONEY", { - amount: `**${amount}** ${client.functions.getNoun(amount, interaction.translate("misc:NOUNS:CREDITS:1"), interaction.translate("misc:NOUNS:CREDITS:2"), interaction.translate("misc:NOUNS:CREDITS:5"))}`, - }); + if (amount > data.memberData.money) + return interaction.error("economy/pay:ENOUGH_MONEY", { + amount: `**${amount}** ${client.functions.getNoun(amount, interaction.translate("misc:NOUNS:CREDITS:1"), interaction.translate("misc:NOUNS:CREDITS:2"), interaction.translate("misc:NOUNS:CREDITS:5"))}`, + }); const memberData = await client.findOrCreateMember({ id: member.id, @@ -95,4 +102,4 @@ class Pay extends BaseCommand { } } -module.exports = Pay; \ No newline at end of file +module.exports = Pay; diff --git a/commands/Economy/profile.js b/commands/Economy/profile.js index 9ca4a71c..24bd6741 100644 --- a/commands/Economy/profile.js +++ b/commands/Economy/profile.js @@ -12,16 +12,19 @@ class Profile extends BaseCommand { .setName("profile") .setDescription(client.translate("economy/profile:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("economy/profile:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("economy/profile:DESCRIPTION", null, "ru-RU"), + uk: client.translate("economy/profile:DESCRIPTION", null, "uk-UA"), + ru: client.translate("economy/profile:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addUserOption(option => option.setName("user") - .setDescription(client.translate("common:USER")) - .setDescriptionLocalizations({ - "uk": client.translate("common:USER", null, "uk-UA"), - "ru": client.translate("common:USER", null, "ru-RU"), - })), + .addUserOption(option => + option + .setName("user") + .setDescription(client.translate("common:USER")) + .setDescriptionLocalizations({ + uk: client.translate("common:USER", null, "uk-UA"), + ru: client.translate("common:USER", null, "ru-RU"), + }), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -46,14 +49,8 @@ class Profile extends BaseCommand { const member = interaction.options.getMember("user") || interaction.member; if (member.user.bot) return interaction.error("economy/profile:BOT_USER"); - const memberData = (member.id === interaction.user.id ? data.memberData : await client.findOrCreateMember({ - id: member.id, - guildId: interaction.guildId, - })); - - const userData = (member.id === interaction.user.id ? data.userData : await client.findOrCreateUser({ - id: member.id, - })); + const memberData = member.id === interaction.user.id ? data.memberData : await client.findOrCreateMember({ id: member.id, guildId: interaction.guildId }); + const userData = member.id === interaction.user.id ? data.userData : await client.findOrCreateUser({ id: member.id }); if (userData.lover && !client.users.cache.find(u => u.id === userData.lover)) await client.users.fetch(userData.lover, true); const guilds = client.guilds.cache.filter(g => g.members.cache.find(m => m.id === member.id)); @@ -107,7 +104,7 @@ class Profile extends BaseCommand { }, { name: interaction.translate("economy/profile:LEVEL"), - value:`**${memberData.level}**`, + value: `**${memberData.level}**`, inline: true, }, { @@ -122,12 +119,12 @@ class Profile extends BaseCommand { }, { name: interaction.translate("economy/profile:BIRTHDATE"), - value: (!userData.birthdate ? interaction.translate("common:NOT_DEFINED") : client.functions.printDate(client, new Date(userData.birthdate))), + value: !userData.birthdate ? interaction.translate("common:NOT_DEFINED") : client.functions.printDate(client, new Date(userData.birthdate)), inline: true, }, { name: interaction.translate("economy/profile:LOVER"), - value: (!userData.lover ? interaction.translate("common:NOT_DEFINED") : lover.getUsername()), + value: !userData.lover ? interaction.translate("common:NOT_DEFINED") : lover.getUsername(), inline: true, }, { @@ -145,12 +142,14 @@ class Profile extends BaseCommand { interaction.editReply({ embeds: [profileEmbed], - files: [{ - name: "achievements.png", - attachment: buffer, - }], + files: [ + { + name: "achievements.png", + attachment: buffer, + }, + ], }); } } -module.exports = Profile; \ No newline at end of file +module.exports = Profile; diff --git a/commands/Economy/rep.js b/commands/Economy/rep.js index ba83fa94..65607d62 100644 --- a/commands/Economy/rep.js +++ b/commands/Economy/rep.js @@ -12,17 +12,20 @@ class Rep extends BaseCommand { .setName("rep") .setDescription(client.translate("economy/rep:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("economy/rep:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("economy/rep:DESCRIPTION", null, "ru-RU"), + uk: client.translate("economy/rep:DESCRIPTION", null, "uk-UA"), + ru: client.translate("economy/rep:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addUserOption(option => option.setName("user") - .setDescription(client.translate("common:USER")) - .setDescriptionLocalizations({ - "uk": client.translate("common:USER", null, "uk-UA"), - "ru": client.translate("common:USER", null, "ru-RU"), - }) - .setRequired(true)), + .addUserOption(option => + option + .setName("user") + .setDescription(client.translate("common:USER")) + .setDescriptionLocalizations({ + uk: client.translate("common:USER", null, "uk-UA"), + ru: client.translate("common:USER", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -44,9 +47,10 @@ class Rep extends BaseCommand { async execute(client, interaction, data) { const isInCooldown = data.userData.cooldowns?.rep; if (isInCooldown) { - if (isInCooldown > Date.now()) return interaction.error("economy/rep:COOLDOWN", { - time: client.functions.convertTime(client, isInCooldown, true, true, data.guildData.language), - }); + if (isInCooldown > Date.now()) + return interaction.error("economy/rep:COOLDOWN", { + time: client.functions.convertTime(client, isInCooldown, true, true, data.guildData.language), + }); } const user = interaction.options.getUser("user"); @@ -67,15 +71,17 @@ class Rep extends BaseCommand { userData.rep++; if (!userData.achievements.rep.achieved) { - userData.achievements.rep.progress.now = (userData.rep > userData.achievements.rep.progress.total ? userData.achievements.rep.progress.total : userData.rep); + userData.achievements.rep.progress.now = userData.rep > userData.achievements.rep.progress.total ? userData.achievements.rep.progress.total : userData.rep; if (userData.achievements.rep.progress.now >= userData.achievements.rep.progress.total) { userData.achievements.rep.achieved = true; interaction.followUp({ content: `${user}`, - files: [{ - name: "achievement_unlocked6.png", - attachment: "./assets/img/achievements/achievement_unlocked6.png", - }], + files: [ + { + name: "achievement_unlocked6.png", + attachment: "./assets/img/achievements/achievement_unlocked6.png", + }, + ], }); } userData.markModified("achievements.rep"); @@ -88,4 +94,4 @@ class Rep extends BaseCommand { } } -module.exports = Rep; \ No newline at end of file +module.exports = Rep; diff --git a/commands/Economy/rob.js b/commands/Economy/rob.js index cc994b20..c8c9c3bb 100644 --- a/commands/Economy/rob.js +++ b/commands/Economy/rob.js @@ -12,24 +12,30 @@ class Rob extends BaseCommand { .setName("rob") .setDescription(client.translate("economy/rob:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("economy/rob:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("economy/rob:DESCRIPTION", null, "ru-RU"), + uk: client.translate("economy/rob:DESCRIPTION", null, "uk-UA"), + ru: client.translate("economy/rob:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addUserOption(option => option.setName("user") - .setDescription(client.translate("common:USER")) - .setDescriptionLocalizations({ - "uk": client.translate("common:USER", null, "uk-UA"), - "ru": client.translate("common:USER", null, "ru-RU"), - }) - .setRequired(true)) - .addIntegerOption(option => option.setName("amount") - .setDescription(client.translate("common:INT")) - .setDescriptionLocalizations({ - "uk": client.translate("common:INT", null, "uk-UA"), - "ru": client.translate("common:INT", null, "ru-RU"), - }) - .setRequired(true)), + .addUserOption(option => + option + .setName("user") + .setDescription(client.translate("common:USER")) + .setDescriptionLocalizations({ + uk: client.translate("common:USER", null, "uk-UA"), + ru: client.translate("common:USER", null, "ru-RU"), + }) + .setRequired(true), + ) + .addIntegerOption(option => + option + .setName("amount") + .setDescription(client.translate("common:INT")) + .setDescriptionLocalizations({ + uk: client.translate("common:INT", null, "uk-UA"), + ru: client.translate("common:INT", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -68,15 +74,16 @@ class Rob extends BaseCommand { } const potentiallyLose = Math.floor(amount * 1.5); - if (potentiallyLose > data.memberData.money) return interaction.error("economy/rob:NOT_ENOUGH_AUTHOR", { - moneyMin: `**${potentiallyLose}** ${client.functions.getNoun(potentiallyLose, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`, - moneyCurrent: `**${data.memberData.money}** ${client.functions.getNoun(data.memberData.money, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`, - }); + if (potentiallyLose > data.memberData.money) + return interaction.error("economy/rob:NOT_ENOUGH_AUTHOR", { + moneyMin: `**${potentiallyLose}** ${client.functions.getNoun(potentiallyLose, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`, + moneyCurrent: `**${data.memberData.money}** ${client.functions.getNoun(data.memberData.money, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`, + }); const itsAWon = Math.floor(client.functions.randomNum(0, 100) < 25); if (itsAWon) { - const toWait = Date.now() + (6 * 60 * 60 * 1000), + const toWait = Date.now() + 6 * 60 * 60 * 1000, randomNum = client.functions.randomNum(1, 2); memberData.cooldowns.rob = toWait; @@ -118,4 +125,4 @@ class Rob extends BaseCommand { } } -module.exports = Rob; \ No newline at end of file +module.exports = Rob; diff --git a/commands/Economy/setbio.js b/commands/Economy/setbio.js index 1c40b4e2..7cc44636 100644 --- a/commands/Economy/setbio.js +++ b/commands/Economy/setbio.js @@ -12,17 +12,20 @@ class Setbio extends BaseCommand { .setName("setbio") .setDescription(client.translate("economy/setbio:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("economy/setbio:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("economy/setbio:DESCRIPTION", null, "ru-RU"), + uk: client.translate("economy/setbio:DESCRIPTION", null, "uk-UA"), + ru: client.translate("economy/setbio:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(true) - .addStringOption(option => option.setName("text") - .setDescription(client.translate("economy/profile:BIO")) - .setDescriptionLocalizations({ - "uk": client.translate("economy/profile:BIO", null, "uk-UA"), - "ru": client.translate("economy/profile:BIO", null, "ru-RU"), - }) - .setRequired(true)), + .addStringOption(option => + option + .setName("text") + .setDescription(client.translate("economy/profile:BIO")) + .setDescriptionLocalizations({ + uk: client.translate("economy/profile:BIO", null, "uk-UA"), + ru: client.translate("economy/profile:BIO", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -53,4 +56,4 @@ class Setbio extends BaseCommand { } } -module.exports = Setbio; \ No newline at end of file +module.exports = Setbio; diff --git a/commands/Economy/slots.js b/commands/Economy/slots.js index 02639c5a..020deb3e 100644 --- a/commands/Economy/slots.js +++ b/commands/Economy/slots.js @@ -12,17 +12,20 @@ class Slots extends BaseCommand { .setName("slots") .setDescription(client.translate("economy/slots:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("economy/slots:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("economy/slots:DESCRIPTION", null, "ru-RU"), + uk: client.translate("economy/slots:DESCRIPTION", null, "uk-UA"), + ru: client.translate("economy/slots:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addIntegerOption(option => option.setName("amount") - .setDescription(client.translate("common:INT")) - .setDescriptionLocalizations({ - "uk": client.translate("common:INT", null, "uk-UA"), - "ru": client.translate("common:INT", null, "ru-RU"), - }) - .setRequired(true)), + .addIntegerOption(option => + option + .setName("amount") + .setDescription(client.translate("common:INT")) + .setDescriptionLocalizations({ + uk: client.translate("common:INT", null, "uk-UA"), + ru: client.translate("common:INT", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -45,19 +48,24 @@ class Slots extends BaseCommand { await interaction.deferReply(); const amount = interaction.options.getInteger("amount"); - if (amount > data.memberData.money) return interaction.error("economy/slots:NOT_ENOUGH", { money: `**${amount}** ${client.functions.getNoun(amount, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}` }, { edit: true }); + if (amount > data.memberData.money) + return interaction.error("economy/slots:NOT_ENOUGH", { + money: `**${amount}** ${client.functions.getNoun(amount, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`, + }, { edit: true }); const fruits = ["🍎", "🍐", "🍌", "🍇", "🍉", "🍒", "🍓"]; - let i1 = 0, j1 = 0, k1 = 0, - i2 = 1, j2 = 1, k2 = 1, - i3 = 2, j3 = 2, k3 = 2; + let i1 = 0, + j1 = 0, + k1 = 0, + i2 = 1, + j2 = 1, + k2 = 1, + i3 = 2, + j3 = 2, + k3 = 2; - const colonnes = [ - client.functions.shuffle(fruits), - client.functions.shuffle(fruits), - client.functions.shuffle(fruits), - ]; + const colonnes = [client.functions.shuffle(fruits), client.functions.shuffle(fruits), client.functions.shuffle(fruits)]; function getCredits(number, isJackpot) { if (!isJackpot) number = number * 1.5; @@ -78,33 +86,35 @@ class Slots extends BaseCommand { async function end() { let msg = "[ :slot_machine: | **СЛОТЫ** ]\n------------------\n"; - i1 = (i1 < fruits.length - 1) ? i1 + 1 : 0; - i2 = (i2 < fruits.length - 1) ? i2 + 1 : 0; - i3 = (i3 < fruits.length - 1) ? i3 + 1 : 0; - j1 = (j1 < fruits.length - 1) ? j1 + 1 : 0; - j2 = (j2 < fruits.length - 1) ? j2 + 1 : 0; - j3 = (j3 < fruits.length - 1) ? j3 + 1 : 0; - k1 = (k1 < fruits.length - 1) ? k1 + 1 : 0; - k2 = (k2 < fruits.length - 1) ? k2 + 1 : 0; - k3 = (k3 < fruits.length - 1) ? k3 + 1 : 0; + i1 = i1 < fruits.length - 1 ? i1 + 1 : 0; + i2 = i2 < fruits.length - 1 ? i2 + 1 : 0; + i3 = i3 < fruits.length - 1 ? i3 + 1 : 0; + j1 = j1 < fruits.length - 1 ? j1 + 1 : 0; + j2 = j2 < fruits.length - 1 ? j2 + 1 : 0; + j3 = j3 < fruits.length - 1 ? j3 + 1 : 0; + k1 = k1 < fruits.length - 1 ? k1 + 1 : 0; + k2 = k2 < fruits.length - 1 ? k2 + 1 : 0; + k3 = k3 < fruits.length - 1 ? k3 + 1 : 0; msg += colonnes[0][i1] + " : " + colonnes[1][j1] + " : " + colonnes[2][k1] + "\n"; msg += colonnes[0][i2] + " : " + colonnes[1][j2] + " : " + colonnes[2][k2] + " **<**\n"; msg += colonnes[0][i3] + " : " + colonnes[1][j3] + " : " + colonnes[2][k3] + "\n------------------\n"; - if ((colonnes[0][i2] == colonnes[1][j2]) && (colonnes[1][j2] == colonnes[2][k2])) { - msg += "| : : : **" + (interaction.translate("common:VICTORY").toUpperCase()) + "** : : : |"; + if (colonnes[0][i2] == colonnes[1][j2] && colonnes[1][j2] == colonnes[2][k2]) { + msg += "| : : : **" + interaction.translate("common:VICTORY").toUpperCase() + "** : : : |"; await interaction.editReply({ content: msg, }); const credits = getCredits(amount, true); interaction.followUp({ - content: "**!! ДЖЕКПОТ !!**\n" + interaction.translate("economy/slots:VICTORY", { - money: `**${amount}** ${client.functions.getNoun(amount, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`, - won: `**${credits}** ${client.functions.getNoun(credits, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`, - user: interaction.member.toString(), - }), + content: + "**!! ДЖЕКПОТ !!**\n" + + interaction.translate("economy/slots:VICTORY", { + money: `**${amount}** ${client.functions.getNoun(amount, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`, + won: `**${credits}** ${client.functions.getNoun(credits, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`, + user: interaction.member.toString(), + }), }); const toAdd = credits - amount; @@ -127,10 +137,12 @@ class Slots extends BaseCommand { if (data.userData.achievements.slots.progress.now === data.userData.achievements.slots.progress.total) { data.userData.achievements.slots.achieved = true; interaction.followUp({ - files: [{ - name: "achievement_unlocked4.png", - attachment: "./assets/img/achievements/achievement_unlocked4.png", - }], + files: [ + { + name: "achievement_unlocked4.png", + attachment: "./assets/img/achievements/achievement_unlocked4.png", + }, + ], }); } data.userData.markModified("achievements.slots"); @@ -142,7 +154,7 @@ class Slots extends BaseCommand { } if (colonnes[0][i2] == colonnes[1][j2] || colonnes[1][j2] == colonnes[2][k2] || colonnes[0][i2] == colonnes[2][k2]) { - msg += "| : : : **" + (interaction.translate("common:VICTORY").toUpperCase()) + "** : : : |"; + msg += "| : : : **" + interaction.translate("common:VICTORY").toUpperCase() + "** : : : |"; await interaction.editReply({ content: msg, }); @@ -175,10 +187,12 @@ class Slots extends BaseCommand { if (data.userData.achievements.slots.progress.now === data.userData.achievements.slots.progress.total) { data.userData.achievements.slots.achieved = true; interaction.followUp({ - files: [{ - name: "achievement_unlocked4.png", - attachment: "./assets/img/achievements/achievement_unlocked4.png", - }], + files: [ + { + name: "achievement_unlocked4.png", + attachment: "./assets/img/achievements/achievement_unlocked4.png", + }, + ], }); } data.userData.markModified("achievements.slots"); @@ -188,7 +202,7 @@ class Slots extends BaseCommand { return; } - msg += "| : : : **" + (interaction.translate("common:DEFEAT").toUpperCase()) + "** : : : |"; + msg += "| : : : **" + interaction.translate("common:DEFEAT").toUpperCase() + "** : : : |"; interaction.followUp({ content: interaction.translate("economy/slots:DEFEAT", { money: `**${amount}** ${client.functions.getNoun(amount, interaction.translate("misc:NOUNS:CREDIT:1"), interaction.translate("misc:NOUNS:CREDIT:2"), interaction.translate("misc:NOUNS:CREDIT:5"))}`, @@ -221,15 +235,15 @@ class Slots extends BaseCommand { async function editMsg() { let msg = "[ :slot_machine: | **СЛОТЫ** ]\n------------------\n"; - i1 = (i1 < fruits.length - 1) ? i1 + 1 : 0; - i2 = (i2 < fruits.length - 1) ? i2 + 1 : 0; - i3 = (i3 < fruits.length - 1) ? i3 + 1 : 0; - j1 = (j1 < fruits.length - 1) ? j1 + 1 : 0; - j2 = (j2 < fruits.length - 1) ? j2 + 1 : 0; - j3 = (j3 < fruits.length - 1) ? j3 + 1 : 0; - k1 = (k1 < fruits.length - 1) ? k1 + 1 : 0; - k2 = (k2 < fruits.length - 1) ? k2 + 1 : 0; - k3 = (k3 < fruits.length - 1) ? k3 + 1 : 0; + i1 = i1 < fruits.length - 1 ? i1 + 1 : 0; + i2 = i2 < fruits.length - 1 ? i2 + 1 : 0; + i3 = i3 < fruits.length - 1 ? i3 + 1 : 0; + j1 = j1 < fruits.length - 1 ? j1 + 1 : 0; + j2 = j2 < fruits.length - 1 ? j2 + 1 : 0; + j3 = j3 < fruits.length - 1 ? j3 + 1 : 0; + k1 = k1 < fruits.length - 1 ? k1 + 1 : 0; + k2 = k2 < fruits.length - 1 ? k2 + 1 : 0; + k3 = k3 < fruits.length - 1 ? k3 + 1 : 0; msg += colonnes[0][i1] + " : " + colonnes[1][j1] + " : " + colonnes[2][k1] + "\n"; msg += colonnes[0][i2] + " : " + colonnes[1][j2] + " : " + colonnes[2][k2] + " **<**\n"; @@ -242,4 +256,4 @@ class Slots extends BaseCommand { } } -module.exports = Slots; \ No newline at end of file +module.exports = Slots; diff --git a/commands/Economy/transactions.js b/commands/Economy/transactions.js index 318a887a..a2c97b31 100644 --- a/commands/Economy/transactions.js +++ b/commands/Economy/transactions.js @@ -12,16 +12,19 @@ class Transactions extends BaseCommand { .setName("transactions") .setDescription(client.translate("economy/transactions:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("economy/transactions:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("economy/transactions:DESCRIPTION", null, "ru-RU"), + uk: client.translate("economy/transactions:DESCRIPTION", null, "uk-UA"), + ru: client.translate("economy/transactions:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addBooleanOption(option => option.setName("clear") - .setDescription(client.translate("economy/transactions:CLEAR")) - .setDescriptionLocalizations({ - "uk": client.translate("economy/transactions:CLEAR", null, "uk-UA"), - "ru": client.translate("economy/transactions:CLEAR", null, "ru-RU"), - })), + .addBooleanOption(option => + option + .setName("clear") + .setDescription(client.translate("economy/transactions:CLEAR")) + .setDescriptionLocalizations({ + uk: client.translate("economy/transactions:CLEAR", null, "uk-UA"), + ru: client.translate("economy/transactions:CLEAR", null, "ru-RU"), + }), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -60,30 +63,36 @@ class Transactions extends BaseCommand { }); const transactions = data.memberData.transactions, - sortedTransactions = [ [], [] ]; + sortedTransactions = [[], []]; transactions.slice(-20).forEach(t => { const array = t.type === "got" ? sortedTransactions[0] : sortedTransactions[1]; - array.push(`${interaction.translate("economy/transactions:T_USER_" + t.type.toUpperCase())}: ${t.user}\n${interaction.translate("economy/transactions:T_AMOUNT")}: ${t.amount}\n${interaction.translate("economy/transactions:T_DATE")}: ${client.functions.printDate(client, t.date, "Do MMMM YYYY, HH:mm", data.guildData.language)}\n`); + array.push( + `${interaction.translate("economy/transactions:T_USER_" + t.type.toUpperCase())}: ${t.user}\n${interaction.translate("economy/transactions:T_AMOUNT")}: ${t.amount}\n${interaction.translate( + "economy/transactions:T_DATE", + )}: ${client.functions.printDate(client, t.date, "Do MMMM YYYY, HH:mm", data.guildData.language)}\n`, + ); }); if (transactions.length < 1) { embed.setDescription(interaction.translate("economy/transactions:NO_TRANSACTIONS")); } else { - if (sortedTransactions[0].length > 0) embed.addFields([ - { - name: interaction.translate("economy/transactions:T_GOT"), - value: sortedTransactions[0].join("\n"), - inline: true, - }, - ]); - if (sortedTransactions[1].length > 0) embed.addFields([ - { - name: interaction.translate("economy/transactions:T_SEND"), - value: sortedTransactions[1].join("\n"), - inline: true, - }, - ]); + if (sortedTransactions[0].length > 0) + embed.addFields([ + { + name: interaction.translate("economy/transactions:T_GOT"), + value: sortedTransactions[0].join("\n"), + inline: true, + }, + ]); + if (sortedTransactions[1].length > 0) + embed.addFields([ + { + name: interaction.translate("economy/transactions:T_SEND"), + value: sortedTransactions[1].join("\n"), + inline: true, + }, + ]); } interaction.reply({ @@ -92,4 +101,4 @@ class Transactions extends BaseCommand { } } -module.exports = Transactions; \ No newline at end of file +module.exports = Transactions; diff --git a/commands/Economy/work.js b/commands/Economy/work.js index 5bc4c187..814b95ef 100644 --- a/commands/Economy/work.js +++ b/commands/Economy/work.js @@ -12,8 +12,8 @@ class Work extends BaseCommand { .setName("work") .setDescription(client.translate("economy/work:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("economy/work:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("economy/work:DESCRIPTION", null, "ru-RU"), + uk: client.translate("economy/work:DESCRIPTION", null, "uk-UA"), + ru: client.translate("economy/work:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false), aliases: [], @@ -37,13 +37,14 @@ class Work extends BaseCommand { async execute(client, interaction, data) { const isInCooldown = data.memberData.cooldowns?.work; if (isInCooldown) { - if (isInCooldown > Date.now()) return interaction.error("economy/work:COOLDOWN", { - time: client.functions.convertTime(client, isInCooldown, true, true, data.guildData.language), - }); + if (isInCooldown > Date.now()) + return interaction.error("economy/work:COOLDOWN", { + time: client.functions.convertTime(client, isInCooldown, true, true, data.guildData.language), + }); } - if (Date.now() > data.memberData.cooldowns.work + (24 * 60 * 60 * 1000)) data.memberData.workStreak = 0; + if (Date.now() > data.memberData.cooldowns.work + 24 * 60 * 60 * 1000) data.memberData.workStreak = 0; - const toWait = Date.now() + (24 * 60 * 60 * 1000); // 24 hours + const toWait = Date.now() + 24 * 60 * 60 * 1000; // 24 hours data.memberData.cooldowns.work = toWait; data.memberData.markModified("cooldowns"); @@ -57,13 +58,7 @@ class Work extends BaseCommand { }) .setColor(client.config.embed.color); - const award = [ - client.customEmojis.letters.a, - client.customEmojis.letters.w, - client.customEmojis.letters.a, - client.customEmojis.letters.r, - client.customEmojis.letters.d, - ]; + const award = [client.customEmojis.letters.a, client.customEmojis.letters.w, client.customEmojis.letters.a, client.customEmojis.letters.r, client.customEmojis.letters.d]; let won = 200; if (data.memberData.workStreak >= 5) { @@ -117,13 +112,16 @@ class Work extends BaseCommand { const messageOptions = { embeds: [embed], }; + if (!data.userData.achievements.work.achieved) { data.userData.achievements.work.progress.now += 1; if (data.userData.achievements.work.progress.now === data.userData.achievements.work.progress.total) { - messageOptions.files = [{ - name: "unlocked.png", - attachment: "./assets/img/achievements/achievement_unlocked1.png", - }]; + messageOptions.files = [ + { + name: "unlocked.png", + attachment: "./assets/img/achievements/achievement_unlocked1.png", + }, + ]; data.userData.achievements.work.achieved = true; } data.userData.markModified("achievements.work"); @@ -134,4 +132,4 @@ class Work extends BaseCommand { } } -module.exports = Work; \ No newline at end of file +module.exports = Work; diff --git a/commands/Fun/8ball.js b/commands/Fun/8ball.js index 0e5c143c..a479d28b 100644 --- a/commands/Fun/8ball.js +++ b/commands/Fun/8ball.js @@ -12,17 +12,20 @@ class Eightball extends BaseCommand { .setName("8ball") .setDescription(client.translate("fun/8ball:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("fun/8ball:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("fun/8ball:DESCRIPTION", null, "ru-RU"), + uk: client.translate("fun/8ball:DESCRIPTION", null, "uk-UA"), + ru: client.translate("fun/8ball:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(true) - .addStringOption(option => option.setName("question") - .setDescription(client.translate("fun/8ball:QUESTION")) - .setDescriptionLocalizations({ - "uk": client.translate("fun/8ball:QUESTION", null, "uk-UA"), - "ru": client.translate("fun/8ball:QUESTION", null, "ru-RU"), - }) - .setRequired(true)), + .addStringOption(option => + option + .setName("question") + .setDescription(client.translate("fun/8ball:QUESTION")) + .setDescriptionLocalizations({ + uk: client.translate("fun/8ball:QUESTION", null, "uk-UA"), + ru: client.translate("fun/8ball:QUESTION", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -55,4 +58,4 @@ class Eightball extends BaseCommand { } } -module.exports = Eightball; \ No newline at end of file +module.exports = Eightball; diff --git a/commands/Fun/cat.js b/commands/Fun/cat.js index aabd2822..d73450cc 100644 --- a/commands/Fun/cat.js +++ b/commands/Fun/cat.js @@ -13,8 +13,8 @@ class Cat extends BaseCommand { .setName("cat") .setDescription(client.translate("fun/cat:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("fun/cat:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("fun/cat:DESCRIPTION", null, "ru-RU"), + uk: client.translate("fun/cat:DESCRIPTION", null, "uk-UA"), + ru: client.translate("fun/cat:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(true), aliases: [], @@ -46,4 +46,4 @@ class Cat extends BaseCommand { } } -module.exports = Cat; \ No newline at end of file +module.exports = Cat; diff --git a/commands/Fun/crab.js b/commands/Fun/crab.js index ad4f41ce..8fbb6634 100644 --- a/commands/Fun/crab.js +++ b/commands/Fun/crab.js @@ -13,8 +13,8 @@ class Crab extends BaseCommand { .setName("crab") .setDescription(client.translate("fun/crab:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("fun/crab:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("fun/crab:DESCRIPTION", null, "ru-RU"), + uk: client.translate("fun/crab:DESCRIPTION", null, "uk-UA"), + ru: client.translate("fun/crab:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(true), aliases: [], @@ -46,4 +46,4 @@ class Crab extends BaseCommand { } } -module.exports = Crab; \ No newline at end of file +module.exports = Crab; diff --git a/commands/Fun/dog.js b/commands/Fun/dog.js index 5dd2f404..755f6a1e 100644 --- a/commands/Fun/dog.js +++ b/commands/Fun/dog.js @@ -13,8 +13,8 @@ class Dog extends BaseCommand { .setName("dog") .setDescription(client.translate("fun/dog:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("fun/dog:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("fun/dog:DESCRIPTION", null, "ru-RU"), + uk: client.translate("fun/dog:DESCRIPTION", null, "uk-UA"), + ru: client.translate("fun/dog:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(true), aliases: [], @@ -46,4 +46,4 @@ class Dog extends BaseCommand { } } -module.exports = Dog; \ No newline at end of file +module.exports = Dog; diff --git a/commands/Fun/lmgtfy.js b/commands/Fun/lmgtfy.js index 25452a3e..5251cb4b 100644 --- a/commands/Fun/lmgtfy.js +++ b/commands/Fun/lmgtfy.js @@ -13,24 +13,30 @@ class LMGTFY extends BaseCommand { .setName("lmgtfy") .setDescription(client.translate("fun/lmgtfy:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("fun/lmgtfy:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("fun/lmgtfy:DESCRIPTION", null, "ru-RU"), + uk: client.translate("fun/lmgtfy:DESCRIPTION", null, "uk-UA"), + ru: client.translate("fun/lmgtfy:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(true) - .addStringOption(option => option.setName("query") - .setDescription(client.translate("fun/lmgtfy:QUERY")) - .setDescriptionLocalizations({ - "uk": client.translate("fun/lmgtfy:QUERY", null, "uk-UA"), - "ru": client.translate("fun/lmgtfy:QUERY", null, "ru-RU"), - }) - .setRequired(true)) - .addBooleanOption(option => option.setName("short") - .setDescription(client.translate("fun/lmgtfy:SHORT")) - .setDescriptionLocalizations({ - "uk": client.translate("fun/lmgtfy:SHORT", null, "uk-UA"), - "ru": client.translate("fun/lmgtfy:SHORT", null, "ru-RU"), - }) - .setRequired(true)), + .addStringOption(option => + option + .setName("query") + .setDescription(client.translate("fun/lmgtfy:QUERY")) + .setDescriptionLocalizations({ + uk: client.translate("fun/lmgtfy:QUERY", null, "uk-UA"), + ru: client.translate("fun/lmgtfy:QUERY", null, "ru-RU"), + }) + .setRequired(true), + ) + .addBooleanOption(option => + option + .setName("short") + .setDescription(client.translate("fun/lmgtfy:SHORT")) + .setDescriptionLocalizations({ + uk: client.translate("fun/lmgtfy:SHORT", null, "uk-UA"), + ru: client.translate("fun/lmgtfy:SHORT", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -70,4 +76,4 @@ class LMGTFY extends BaseCommand { } } -module.exports = LMGTFY; \ No newline at end of file +module.exports = LMGTFY; diff --git a/commands/Fun/lovecalc.js b/commands/Fun/lovecalc.js index 9679f4a2..f0122550 100644 --- a/commands/Fun/lovecalc.js +++ b/commands/Fun/lovecalc.js @@ -13,25 +13,29 @@ class Lovecalc extends BaseCommand { .setName("lovecalc") .setDescription(client.translate("fun/lovecalc:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("fun/lovecalc:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("fun/lovecalc:DESCRIPTION", null, "ru-RU"), + uk: client.translate("fun/lovecalc:DESCRIPTION", null, "uk-UA"), + ru: client.translate("fun/lovecalc:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) .addUserOption(option => - option.setName("first_member") + option + .setName("first_member") .setDescription(client.translate("common:USER")) .setDescriptionLocalizations({ - "uk": client.translate("common:USER", null, "uk-UA"), - "ru": client.translate("common:USER", null, "ru-RU"), + uk: client.translate("common:USER", null, "uk-UA"), + ru: client.translate("common:USER", null, "ru-RU"), }) - .setRequired(true)) + .setRequired(true), + ) .addUserOption(option => - option.setName("second_member") + option + .setName("second_member") .setDescription(client.translate("common:USER")) .setDescriptionLocalizations({ - "uk": client.translate("common:USER", null, "uk-UA"), - "ru": client.translate("common:USER", null, "ru-RU"), - })), + uk: client.translate("common:USER", null, "uk-UA"), + ru: client.translate("common:USER", null, "ru-RU"), + }), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -67,11 +71,13 @@ class Lovecalc extends BaseCommand { .setAuthor({ name: `❤️ ${interaction.translate("fun/lovecalc:DESCRIPTION")}`, }) - .setDescription(interaction.translate("fun/lovecalc:CONTENT", { - percent, - firstMember: firstMember.user.toString(), - secondMember: secondMember.user.toString(), - })) + .setDescription( + interaction.translate("fun/lovecalc:CONTENT", { + percent, + firstMember: firstMember.user.toString(), + secondMember: secondMember.user.toString(), + }), + ) .setColor(client.config.embed.color) .setFooter({ text: client.config.embed.footer, @@ -83,4 +89,4 @@ class Lovecalc extends BaseCommand { } } -module.exports = Lovecalc; \ No newline at end of file +module.exports = Lovecalc; diff --git a/commands/Fun/number.js b/commands/Fun/number.js index 04b32d97..1fa59ca9 100644 --- a/commands/Fun/number.js +++ b/commands/Fun/number.js @@ -13,8 +13,8 @@ class Number extends BaseCommand { .setName("number") .setDescription(client.translate("fun/number:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("fun/number:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("fun/number:DESCRIPTION", null, "ru-RU"), + uk: client.translate("fun/number:DESCRIPTION", null, "uk-UA"), + ru: client.translate("fun/number:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false), aliases: [], @@ -48,7 +48,7 @@ class Number extends BaseCommand { const filter = m => !m.author.bot; const collector = new MessageCollector(interaction.channel, { filter, - time: (5 * 60 * 1000), + time: 5 * 60 * 1000, }); currentGames[interaction.guildId] = true; @@ -102,12 +102,14 @@ class Number extends BaseCommand { collector.stop(); } - if (parseInt(msg.content) < number) msg.reply({ - content: interaction.translate("fun/number:TOO_BIG", { user: msg.author.toString(), number: parsedNumber }), - }); - if (parseInt(msg.content) > number) msg.reply({ - content: interaction.translate("fun/number:TOO_SMALL", { user: msg.author.toString(), number: parsedNumber }), - }); + if (parseInt(msg.content) < number) + msg.reply({ + content: interaction.translate("fun/number:TOO_BIG", { user: msg.author.toString(), number: parsedNumber }), + }); + if (parseInt(msg.content) > number) + msg.reply({ + content: interaction.translate("fun/number:TOO_SMALL", { user: msg.author.toString(), number: parsedNumber }), + }); }); collector.on("end", (_, reason) => { @@ -118,4 +120,4 @@ class Number extends BaseCommand { } } -module.exports = Number; \ No newline at end of file +module.exports = Number; diff --git a/commands/Fun/tictactoe.js b/commands/Fun/tictactoe.js index 312667bd..5d018620 100644 --- a/commands/Fun/tictactoe.js +++ b/commands/Fun/tictactoe.js @@ -13,17 +13,20 @@ class TicTacToe extends BaseCommand { .setName("tictactoe") .setDescription(client.translate("fun/tictactoe:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("fun/tictactoe:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("fun/tictactoe:DESCRIPTION", null, "ru-RU"), + uk: client.translate("fun/tictactoe:DESCRIPTION", null, "uk-UA"), + ru: client.translate("fun/tictactoe:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addUserOption(option => option.setName("user") - .setDescription(client.translate("common:USER")) - .setDescriptionLocalizations({ - "uk": client.translate("common:USER", null, "uk-UA"), - "ru": client.translate("common:USER", null, "ru-RU"), - }) - .setRequired(true)), + .addUserOption(option => + option + .setName("user") + .setDescription(client.translate("common:USER")) + .setDescriptionLocalizations({ + uk: client.translate("common:USER", null, "uk-UA"), + ru: client.translate("common:USER", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -68,4 +71,4 @@ class TicTacToe extends BaseCommand { } } -module.exports = TicTacToe; \ No newline at end of file +module.exports = TicTacToe; diff --git a/commands/General/afk.js b/commands/General/afk.js index bd6e73e6..92d6fa5d 100644 --- a/commands/General/afk.js +++ b/commands/General/afk.js @@ -12,17 +12,20 @@ class Afk extends BaseCommand { .setName("afk") .setDescription(client.translate("general/afk:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("general/afk:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("general/afk:DESCRIPTION", null, "ru-RU"), + uk: client.translate("general/afk:DESCRIPTION", null, "uk-UA"), + ru: client.translate("general/afk:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(true) - .addStringOption(option => option.setName("message") - .setDescription(client.translate("common:MESSAGE")) - .setDescriptionLocalizations({ - "uk": client.translate("common:MESSAGE", null, "uk-UA"), - "ru": client.translate("common:MESSAGE", null, "ru-RU"), - }) - .setRequired(true)), + .addStringOption(option => + option + .setName("message") + .setDescription(client.translate("common:MESSAGE")) + .setDescriptionLocalizations({ + uk: client.translate("common:MESSAGE", null, "uk-UA"), + ru: client.translate("common:MESSAGE", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -56,4 +59,4 @@ class Afk extends BaseCommand { } } -module.exports = Afk; \ No newline at end of file +module.exports = Afk; diff --git a/commands/General/avatar.js b/commands/General/avatar.js index 77f7b4c0..db6eec7f 100644 --- a/commands/General/avatar.js +++ b/commands/General/avatar.js @@ -12,22 +12,28 @@ class Avatar extends BaseCommand { .setName("avatar") .setDescription(client.translate("general/avatar:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("general/avatar:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("general/avatar:DESCRIPTION", null, "ru-RU"), + uk: client.translate("general/avatar:DESCRIPTION", null, "uk-UA"), + ru: client.translate("general/avatar:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(true) - .addUserOption(option => option.setName("user") - .setDescription(client.translate("common:USER")) - .setDescriptionLocalizations({ - "uk": client.translate("common:USER", null, "uk-UA"), - "ru": client.translate("common:USER", null, "ru-RU"), - })) - .addBooleanOption(option => option.setName("server") - .setDescription(client.translate("general/avatar:SERVER")) - .setDescriptionLocalizations({ - "uk": client.translate("general/avatar:SERVER", null, "uk-UA"), - "ru": client.translate("general/avatar:SERVER", null, "ru-RU"), - })), + .addUserOption(option => + option + .setName("user") + .setDescription(client.translate("common:USER")) + .setDescriptionLocalizations({ + uk: client.translate("common:USER", null, "uk-UA"), + ru: client.translate("common:USER", null, "ru-RU"), + }), + ) + .addBooleanOption(option => + option + .setName("server") + .setDescription(client.translate("general/avatar:SERVER")) + .setDescriptionLocalizations({ + uk: client.translate("general/avatar:SERVER", null, "uk-UA"), + ru: client.translate("general/avatar:SERVER", null, "ru-RU"), + }), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -51,11 +57,13 @@ class Avatar extends BaseCommand { const avatarURL = interaction.options.getBoolean("server") ? member.avatarURL({ size: 512 }) : member.user.avatarURL({ size: 512 }); interaction.reply({ - files: [{ - attachment: avatarURL, - }], + files: [ + { + attachment: avatarURL, + }, + ], }); } } -module.exports = Avatar; \ No newline at end of file +module.exports = Avatar; diff --git a/commands/General/boosters.js b/commands/General/boosters.js index 785fbbf0..8ba349fd 100644 --- a/commands/General/boosters.js +++ b/commands/General/boosters.js @@ -12,8 +12,8 @@ class Boosters extends BaseCommand { .setName("boosters") .setDescription(client.translate("general/boosters:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("general/boosters:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("general/boosters:DESCRIPTION", null, "ru-RU"), + uk: client.translate("general/boosters:DESCRIPTION", null, "uk-UA"), + ru: client.translate("general/boosters:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false), aliases: [], @@ -43,25 +43,12 @@ class Boosters extends BaseCommand { const embeds = generateBoostersEmbeds(client, interaction, boosters, data.guildData); - const row = new ActionRowBuilder() - .addComponents( - new ButtonBuilder() - .setCustomId("boosters_prev_page") - .setStyle(ButtonStyle.Primary) - .setEmoji("⬅️"), - new ButtonBuilder() - .setCustomId("boosters_next_page") - .setStyle(ButtonStyle.Primary) - .setEmoji("➡️"), - new ButtonBuilder() - .setCustomId("boosters_jump_page") - .setStyle(ButtonStyle.Secondary) - .setEmoji("↗️"), - new ButtonBuilder() - .setCustomId("boosters_stop") - .setStyle(ButtonStyle.Danger) - .setEmoji("⏹️"), - ); + const row = new ActionRowBuilder().addComponents( + new ButtonBuilder().setCustomId("boosters_prev_page").setStyle(ButtonStyle.Primary).setEmoji("⬅️"), + new ButtonBuilder().setCustomId("boosters_next_page").setStyle(ButtonStyle.Primary).setEmoji("➡️"), + new ButtonBuilder().setCustomId("boosters_jump_page").setStyle(ButtonStyle.Secondary).setEmoji("↗️"), + new ButtonBuilder().setCustomId("boosters_stop").setStyle(ButtonStyle.Danger).setEmoji("⏹️"), + ); await interaction.editReply({ content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`, @@ -70,7 +57,7 @@ class Boosters extends BaseCommand { }); const filter = i => i.user.id === interaction.user.id; - const collector = interaction.guild === null ? (await interaction.user.createDM()).createMessageComponentCollector({ filter, idle: (20 * 1000) }) : interaction.channel.createMessageComponentCollector({ filter, idle: (20 * 1000) }); + const collector = interaction.guild === null ? (await interaction.user.createDM()).createMessageComponentCollector({ filter, idle: 20 * 1000 }) : interaction.channel.createMessageComponentCollector({ filter, idle: 20 * 1000 }); collector.on("collect", async i => { if (i.isButton()) { @@ -110,7 +97,7 @@ class Boosters extends BaseCommand { return res.author.id === interaction.user.id && !isNaN(res.content); }; - interaction.channel.awaitMessages({ filter, max: 1, time: (10 * 1000) }).then(collected => { + interaction.channel.awaitMessages({ filter, max: 1, time: 10 * 1000 }).then(collected => { if (embeds[collected.first().content - 1]) { currentPage = collected.first().content - 1; interaction.editReply({ @@ -159,7 +146,10 @@ function generateBoostersEmbeds(client, interaction, boosters, guildData) { let k = 10; for (let i = 0; i < boosters.size; i += 10) { - const current = boosters.sort((a, b) => a.premiumSinceTimestamp - b.premiumSinceTimestamp).map(g => g).slice(i, k); + const current = boosters + .sort((a, b) => a.premiumSinceTimestamp - b.premiumSinceTimestamp) + .map(g => g) + .slice(i, k); let j = i; k += 10; @@ -179,4 +169,4 @@ function generateBoostersEmbeds(client, interaction, boosters, guildData) { return embeds; } -module.exports = Boosters; \ No newline at end of file +module.exports = Boosters; diff --git a/commands/General/emoji.js b/commands/General/emoji.js index 3308f830..303b5de2 100644 --- a/commands/General/emoji.js +++ b/commands/General/emoji.js @@ -12,17 +12,20 @@ class Emoji extends BaseCommand { .setName("emoji") .setDescription(client.translate("general/emoji:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("general/emoji:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("general/emoji:DESCRIPTION", null, "ru-RU"), + uk: client.translate("general/emoji:DESCRIPTION", null, "uk-UA"), + ru: client.translate("general/emoji:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(true) - .addStringOption(option => option.setName("emoji") - .setDescription(client.translate("common:EMOJI")) - .setDescriptionLocalizations({ - "uk": client.translate("commom:EMOJI", null, "uk-UA"), - "ru": client.translate("common:EMOJI", null, "ru-RU"), - }) - .setRequired(true)), + .addStringOption(option => + option + .setName("emoji") + .setDescription(client.translate("common:EMOJI")) + .setDescriptionLocalizations({ + uk: client.translate("commom:EMOJI", null, "uk-UA"), + ru: client.translate("common:EMOJI", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -80,4 +83,4 @@ class Emoji extends BaseCommand { } } -module.exports = Emoji; \ No newline at end of file +module.exports = Emoji; diff --git a/commands/General/help.js b/commands/General/help.js index 60db1154..af2beeb6 100644 --- a/commands/General/help.js +++ b/commands/General/help.js @@ -12,18 +12,20 @@ class Help extends BaseCommand { .setName("help") .setDescription(client.translate("general/help:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("general/help:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("general/help:DESCRIPTION", null, "ru-RU"), + uk: client.translate("general/help:DESCRIPTION", null, "uk-UA"), + ru: client.translate("general/help:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(true) .addStringOption(option => - option.setName("command") + option + .setName("command") .setDescription(client.translate("common:COMMAND")) .setDescriptionLocalizations({ - "uk": client.translate("common:COMMAND", null, "uk-UA"), - "ru": client.translate("common:COMMAND", null, "ru-RU"), + uk: client.translate("common:COMMAND", null, "uk-UA"), + ru: client.translate("common:COMMAND", null, "ru-RU"), }) - .setAutocomplete(true)), + .setAutocomplete(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -52,7 +54,7 @@ class Help extends BaseCommand { if (command) { if (commands.find(c => c.command.name === command).category === "Owner" && interaction.user.id !== client.config.owner.id) return interaction.error("misc:OWNER_ONLY", null, { edit: true, ephemeral: true }); - return interaction.editReply({ embeds: [ generateCommandHelp(interaction, command) ] }); + return interaction.editReply({ embeds: [generateCommandHelp(interaction, command)] }); } commands.forEach(c => { @@ -72,13 +74,7 @@ class Help extends BaseCommand { }; }); - const row = new ActionRowBuilder() - .addComponents( - new StringSelectMenuBuilder() - .setCustomId("help_category_select") - .setPlaceholder(client.translate("common:NOTHING_SELECTED")) - .addOptions(categoriesRows), - ); + const row = new ActionRowBuilder().addComponents(new StringSelectMenuBuilder().setCustomId("help_category_select").setPlaceholder(client.translate("common:NOTHING_SELECTED")).addOptions(categoriesRows)); const msg = await interaction.editReply({ content: interaction.translate("common:AVAILABLE_OPTIONS"), @@ -87,19 +83,21 @@ class Help extends BaseCommand { }); const filter = i => i.user.id === interaction.user.id; - const collector = msg.createMessageComponentCollector({ filter, idle: (15 * 1000) }); + const collector = msg.createMessageComponentCollector({ filter, idle: 15 * 1000 }); collector.on("collect", async i => { if (i.isStringSelectMenu() && i.customId === "help_category_select") { i.deferUpdate(); const arg = i?.values[0]; - const categoryCommands = commands.filter(cmd => cmd.category === arg).map(c => { - return { - name: `**${c.command.name}**`, - value: interaction.translate(`${arg.toLowerCase()}/${c.command.name}:DESCRIPTION`), - }; - }); + const categoryCommands = commands + .filter(cmd => cmd.category === arg) + .map(c => { + return { + name: `**${c.command.name}**`, + value: interaction.translate(`${arg.toLowerCase()}/${c.command.name}:DESCRIPTION`), + }; + }); const embed = new EmbedBuilder() .setColor(client.config.embed.color) @@ -146,14 +144,13 @@ class Help extends BaseCommand { results.slice(0, 25).map(command => ({ name: command.command.name, value: command.command.name, - }), - )); + })), + ); } } function getPermName(bitfield = 0) { - for (const key in PermissionsBitField.Flags) - if (PermissionsBitField.Flags[key] === BigInt(bitfield)) return key; + for (const key in PermissionsBitField.Flags) if (PermissionsBitField.Flags[key] === BigInt(bitfield)) return key; return null; } @@ -161,9 +158,7 @@ function generateCommandHelp(interaction, command) { const cmd = interaction.client.commands.get(command); if (!cmd) return interaction.error("general/help:NOT_FOUND", { command }, { edit: true }); - const usage = interaction.translate(`${cmd.category.toLowerCase()}/${cmd.command.name}:USAGE`) === "" ? - interaction.translate("misc:NO_ARGS") - : interaction.translate(`${cmd.category.toLowerCase()}/${cmd.command.name}:USAGE`); + const usage = interaction.translate(`${cmd.category.toLowerCase()}/${cmd.command.name}:USAGE`) === "" ? interaction.translate("misc:NO_ARGS") : interaction.translate(`${cmd.category.toLowerCase()}/${cmd.command.name}:USAGE`); const embed = new EmbedBuilder() .setAuthor({ @@ -201,4 +196,4 @@ function generateCommandHelp(interaction, command) { return embed; } -module.exports = Help; \ No newline at end of file +module.exports = Help; diff --git a/commands/General/minecraft.js b/commands/General/minecraft.js index 7db4502b..0203d203 100644 --- a/commands/General/minecraft.js +++ b/commands/General/minecraft.js @@ -13,17 +13,20 @@ class Minecraft extends BaseCommand { .setName("minecraft") .setDescription(client.translate("general/minecraft:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("general/minecraft:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("general/minecraft:DESCRIPTION", null, "ru-RU"), + uk: client.translate("general/minecraft:DESCRIPTION", null, "uk-UA"), + ru: client.translate("general/minecraft:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(true) - .addStringOption(option => option.setName("ip") - .setDescription(client.translate("common:IP")) - .setDescriptionLocalizations({ - "uk": client.translate("common:IP", null, "uk-UA"), - "ru": client.translate("common:IP", null, "ru-RU"), - }) - .setRequired(true)), + .addStringOption(option => + option + .setName("ip") + .setDescription(client.translate("common:IP")) + .setDescriptionLocalizations({ + uk: client.translate("common:IP", null, "uk-UA"), + ru: client.translate("common:IP", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -77,7 +80,17 @@ class Minecraft extends BaseCommand { }, { name: interaction.translate("general/minecraft:FIELD_CONNECTED"), - value: `**${(res.raw.players ? res.raw.players.online : res.players.length)}** ${client.functions.getNoun((res.raw.players ? res.raw.players.online : res.players.length), interaction.translate("misc:NOUNS:PLAYERS:1"), interaction.translate("misc:NOUNS:PLAYERS:2"), interaction.translate("misc:NOUNS:PLAYERS:5"))} / **${(res.raw.players ? res.raw.players.max : res.maxplayers)}** ${client.functions.getNoun((res.raw.players ? res.raw.players.max : res.maxplayers), interaction.translate("misc:NOUNS:PLAYERS:1"), interaction.translate("misc:NOUNS:PLAYERS:2"), interaction.translate("misc:NOUNS:PLAYERS:5"))}`, + value: `**${res.raw.players ? res.raw.players.online : res.players.length}** ${client.functions.getNoun( + res.raw.players ? res.raw.players.online : res.players.length, + interaction.translate("misc:NOUNS:PLAYERS:1"), + interaction.translate("misc:NOUNS:PLAYERS:2"), + interaction.translate("misc:NOUNS:PLAYERS:5"), + )} / **${res.raw.players ? res.raw.players.max : res.maxplayers}** ${client.functions.getNoun( + res.raw.players ? res.raw.players.max : res.maxplayers, + interaction.translate("misc:NOUNS:PLAYERS:1"), + interaction.translate("misc:NOUNS:PLAYERS:2"), + interaction.translate("misc:NOUNS:PLAYERS:5"), + )}`, }, { name: interaction.translate("general/minecraft:FIELD_IP"), @@ -88,7 +101,6 @@ class Minecraft extends BaseCommand { name: interaction.translate("general/minecraft:FIELD_VERSION"), value: res.raw.vanilla.raw.version.name, inline: true, - }, { name: interaction.translate("general/minecraft:FIELD_PING"), @@ -107,4 +119,4 @@ class Minecraft extends BaseCommand { } } -module.exports = Minecraft; \ No newline at end of file +module.exports = Minecraft; diff --git a/commands/General/ping.js b/commands/General/ping.js index 721ebb14..3daa391b 100644 --- a/commands/General/ping.js +++ b/commands/General/ping.js @@ -12,8 +12,8 @@ class Ping extends BaseCommand { .setName("ping") .setDescription(client.translate("general/ping:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("general/ping:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("general/ping:DESCRIPTION", null, "ru-RU"), + uk: client.translate("general/ping:DESCRIPTION", null, "uk-UA"), + ru: client.translate("general/ping:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(true), aliases: [], @@ -44,9 +44,11 @@ class Ping extends BaseCommand { name: interaction.translate("general/ping:PONG"), iconURL: client.user.avatarURL(), }) - .setDescription(interaction.translate("general/ping:PING", { - ping: Math.round(client.ws.ping), - })); + .setDescription( + interaction.translate("general/ping:PING", { + ping: Math.round(client.ws.ping), + }), + ); interaction.reply({ embeds: [embed], @@ -54,4 +56,4 @@ class Ping extends BaseCommand { } } -module.exports = Ping; \ No newline at end of file +module.exports = Ping; diff --git a/commands/General/remindme.js b/commands/General/remindme.js index 8679aa4e..7ffc0921 100644 --- a/commands/General/remindme.js +++ b/commands/General/remindme.js @@ -14,24 +14,30 @@ class Remindme extends BaseCommand { .setName("remindme") .setDescription(client.translate("general/remindme:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("general/remindme:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("general/remindme:DESCRIPTION", null, "ru-RU"), + uk: client.translate("general/remindme:DESCRIPTION", null, "uk-UA"), + ru: client.translate("general/remindme:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(true) - .addStringOption(option => option.setName("time") - .setDescription(client.translate("general/remindme:TIME")) - .setDescriptionLocalizations({ - "uk": client.translate("general/remindme:TIME", null, "uk-UA"), - "ru": client.translate("general/remindme:TIME", null, "ru-RU"), - }) - .setRequired(true)) - .addStringOption(option => option.setName("message") - .setDescription(client.translate("common:MESSAGE")) - .setDescriptionLocalizations({ - "uk": client.translate("common:MESSAGE", null, "uk-UA"), - "ru": client.translate("common:MESSAGE", null, "ru-RU"), - }) - .setRequired(true)), + .addStringOption(option => + option + .setName("time") + .setDescription(client.translate("general/remindme:TIME")) + .setDescriptionLocalizations({ + uk: client.translate("general/remindme:TIME", null, "uk-UA"), + ru: client.translate("general/remindme:TIME", null, "ru-RU"), + }) + .setRequired(true), + ) + .addStringOption(option => + option + .setName("message") + .setDescription(client.translate("common:MESSAGE")) + .setDescriptionLocalizations({ + uk: client.translate("common:MESSAGE", null, "uk-UA"), + ru: client.translate("common:MESSAGE", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -76,4 +82,4 @@ class Remindme extends BaseCommand { } } -module.exports = Remindme; \ No newline at end of file +module.exports = Remindme; diff --git a/commands/General/report.js b/commands/General/report.js index 2ee0d952..1ca82e1d 100644 --- a/commands/General/report.js +++ b/commands/General/report.js @@ -12,24 +12,30 @@ class Report extends BaseCommand { .setName("report") .setDescription(client.translate("general/report:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("general/report:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("general/report:DESCRIPTION", null, "ru-RU"), + uk: client.translate("general/report:DESCRIPTION", null, "uk-UA"), + ru: client.translate("general/report:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addUserOption(option => option.setName("user") - .setDescription(client.translate("common:USER")) - .setDescriptionLocalizations({ - "uk": client.translate("common:USER", null, "uk-UA"), - "ru": client.translate("common:USER", null, "ru-RU"), - }) - .setRequired(true)) - .addStringOption(option => option.setName("message") - .setDescription(client.translate("common:MESSAGE")) - .setDescriptionLocalizations({ - "uk": client.translate("common:MESSAGE", null, "uk-UA"), - "ru": client.translate("common:MESSAGE", null, "ru-RU"), - }) - .setRequired(true)), + .addUserOption(option => + option + .setName("user") + .setDescription(client.translate("common:USER")) + .setDescriptionLocalizations({ + uk: client.translate("common:USER", null, "uk-UA"), + ru: client.translate("common:USER", null, "ru-RU"), + }) + .setRequired(true), + ) + .addStringOption(option => + option + .setName("message") + .setDescription(client.translate("common:MESSAGE")) + .setDescriptionLocalizations({ + uk: client.translate("common:MESSAGE", null, "uk-UA"), + ru: client.translate("common:MESSAGE", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -109,4 +115,4 @@ class Report extends BaseCommand { } } -module.exports = Report; \ No newline at end of file +module.exports = Report; diff --git a/commands/General/serverinfo.js b/commands/General/serverinfo.js index 35a7f051..4b58ca39 100644 --- a/commands/General/serverinfo.js +++ b/commands/General/serverinfo.js @@ -12,8 +12,8 @@ class Serverinfo extends BaseCommand { .setName("serverinfo") .setDescription(client.translate("general/serverinfo:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("general/serverinfo:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("general/serverinfo:DESCRIPTION", null, "ru-RU"), + uk: client.translate("general/serverinfo:DESCRIPTION", null, "uk-UA"), + ru: client.translate("general/serverinfo:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false), aliases: [], @@ -63,8 +63,20 @@ class Serverinfo extends BaseCommand { }, { name: client.customEmojis.users + interaction.translate("common:MEMBERS"), - value: `${guild.members.cache.filter(m => !m.user.bot).size} ${client.functions.getNoun(guild.members.cache.filter(m => !m.user.bot).size, interaction.translate("misc:NOUNS:MEMBERS:1"), interaction.translate("misc:NOUNS:MEMBERS:2"), interaction.translate("misc:NOUNS:MEMBERS:5"))}` + - "\n" + `${guild.members.cache.filter(m => m.user.bot).size} ${client.functions.getNoun(guild.members.cache.filter(m => m.user.bot).size, interaction.translate("misc:NOUNS:BOTS:1"), interaction.translate("misc:NOUNS:BOTS:2"), interaction.translate("misc:NOUNS:BOTS:5"))}`, + value: + `${guild.members.cache.filter(m => !m.user.bot).size} ${client.functions.getNoun( + guild.members.cache.filter(m => !m.user.bot).size, + interaction.translate("misc:NOUNS:MEMBERS:1"), + interaction.translate("misc:NOUNS:MEMBERS:2"), + interaction.translate("misc:NOUNS:MEMBERS:5"), + )}` + + "\n" + + `${guild.members.cache.filter(m => m.user.bot).size} ${client.functions.getNoun( + guild.members.cache.filter(m => m.user.bot).size, + interaction.translate("misc:NOUNS:BOTS:1"), + interaction.translate("misc:NOUNS:BOTS:2"), + interaction.translate("misc:NOUNS:BOTS:5"), + )}`, inline: true, }, { @@ -89,9 +101,27 @@ class Serverinfo extends BaseCommand { }, { name: client.customEmojis.channels + interaction.translate("common:CHANNELS"), - value: `${guild.channels.cache.filter(c => c.type === ChannelType.GuildText).size} ${client.functions.getNoun(guild.channels.cache.filter(c => c.type === ChannelType.GuildText).size, interaction.translate("misc:NOUNS:TEXT:1"), interaction.translate("misc:NOUNS:TEXT:2"), interaction.translate("misc:NOUNS:TEXT:5"))}` + - "\n" + `${guild.channels.cache.filter(c => c.type === ChannelType.GuildVoice).size} ${client.functions.getNoun(guild.channels.cache.filter(c => c.type === ChannelType.GuildVoice).size, interaction.translate("misc:NOUNS:VOICE:1"), interaction.translate("misc:NOUNS:VOICE:2"), interaction.translate("misc:NOUNS:VOICE:5"))}` + - "\n" + `${guild.channels.cache.filter(c => c.type === ChannelType.GuildCategory).size} ${client.functions.getNoun(guild.channels.cache.filter(c => c.type === ChannelType.GuildCategory).size, interaction.translate("misc:NOUNS:CATEGORY:1"), interaction.translate("misc:NOUNS:CATEGORY:2"), interaction.translate("misc:NOUNS:CATEGORY:5"))}`, + value: + `${guild.channels.cache.filter(c => c.type === ChannelType.GuildText).size} ${client.functions.getNoun( + guild.channels.cache.filter(c => c.type === ChannelType.GuildText).size, + interaction.translate("misc:NOUNS:TEXT:1"), + interaction.translate("misc:NOUNS:TEXT:2"), + interaction.translate("misc:NOUNS:TEXT:5"), + )}` + + "\n" + + `${guild.channels.cache.filter(c => c.type === ChannelType.GuildVoice).size} ${client.functions.getNoun( + guild.channels.cache.filter(c => c.type === ChannelType.GuildVoice).size, + interaction.translate("misc:NOUNS:VOICE:1"), + interaction.translate("misc:NOUNS:VOICE:2"), + interaction.translate("misc:NOUNS:VOICE:5"), + )}` + + "\n" + + `${guild.channels.cache.filter(c => c.type === ChannelType.GuildCategory).size} ${client.functions.getNoun( + guild.channels.cache.filter(c => c.type === ChannelType.GuildCategory).size, + interaction.translate("misc:NOUNS:CATEGORY:1"), + interaction.translate("misc:NOUNS:CATEGORY:2"), + interaction.translate("misc:NOUNS:CATEGORY:5"), + )}`, inline: true, }, ]) @@ -107,4 +137,4 @@ class Serverinfo extends BaseCommand { } } -module.exports = Serverinfo; \ No newline at end of file +module.exports = Serverinfo; diff --git a/commands/General/shorturl.js b/commands/General/shorturl.js index 170e6d07..7ce342a1 100644 --- a/commands/General/shorturl.js +++ b/commands/General/shorturl.js @@ -13,17 +13,20 @@ class Shorturl extends BaseCommand { .setName("shorturl") .setDescription(client.translate("general/shorturl:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("general/shorturl:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("general/shorturl:DESCRIPTION", null, "ru-RU"), + uk: client.translate("general/shorturl:DESCRIPTION", null, "uk-UA"), + ru: client.translate("general/shorturl:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(true) - .addStringOption(option => option.setName("url") - .setDescription(client.translate("common:URL")) - .setDescriptionLocalizations({ - "uk": client.translate("common:URL", null, "uk-UA"), - "ru": client.translate("common:URL", null, "ru-RU"), - }) - .setRequired(true)), + .addStringOption(option => + option + .setName("url") + .setDescription(client.translate("common:URL")) + .setDescriptionLocalizations({ + uk: client.translate("common:URL", null, "uk-UA"), + ru: client.translate("common:URL", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -53,4 +56,4 @@ class Shorturl extends BaseCommand { } } -module.exports = Shorturl; \ No newline at end of file +module.exports = Shorturl; diff --git a/commands/General/stats.js b/commands/General/stats.js index 8bc3dbca..e3af50bf 100644 --- a/commands/General/stats.js +++ b/commands/General/stats.js @@ -12,8 +12,8 @@ class Stats extends BaseCommand { .setName("stats") .setDescription(client.translate("general/stats:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("general/stats:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("general/stats:DESCRIPTION", null, "ru-RU"), + uk: client.translate("general/stats:DESCRIPTION", null, "uk-UA"), + ru: client.translate("general/stats:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(true), aliases: [], @@ -80,7 +80,12 @@ class Stats extends BaseCommand { { name: client.customEmojis.voice + " " + interaction.translate("general/stats:MUSIC_TITLE"), value: interaction.translate("general/stats:MUSIC_CONTENT", { - count: `${client.player.nodes.cache.size} ${client.functions.getNoun(client.player.nodes.cache.size, interaction.translate("misc:NOUNS:SERVERS:1"), interaction.translate("misc:NOUNS:SERVERS:2"), interaction.translate("misc:NOUNS:SERVERS:5"))}`, + count: `${client.player.nodes.cache.size} ${client.functions.getNoun( + client.player.nodes.cache.size, + interaction.translate("misc:NOUNS:SERVERS:1"), + interaction.translate("misc:NOUNS:SERVERS:2"), + interaction.translate("misc:NOUNS:SERVERS:5"), + )}`, }), }, { @@ -92,7 +97,7 @@ class Stats extends BaseCommand { value: interaction.translate("misc:STATS_FOOTER", { dashboardLink: client.config.dashboard.domain, supportLink: "https://discord.gg/Ptkj2n9nzZ", - inviteLink: client.generateInvite({ scopes: ["bot", "applications.commands"], permissions: [ PermissionsBitField.Flags.Administrator ] }), + inviteLink: client.generateInvite({ scopes: ["bot", "applications.commands"], permissions: [PermissionsBitField.Flags.Administrator] }), donateLink: "https://www.donationalerts.com/r/jonny_bro", owner: client.config.owner.id, }), @@ -105,4 +110,4 @@ class Stats extends BaseCommand { } } -module.exports = Stats; \ No newline at end of file +module.exports = Stats; diff --git a/commands/General/suggest.js b/commands/General/suggest.js index be3da7f3..a3efa801 100644 --- a/commands/General/suggest.js +++ b/commands/General/suggest.js @@ -12,17 +12,20 @@ class Suggest extends BaseCommand { .setName("suggest") .setDescription(client.translate("general/suggest:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("general/suggest:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("general/suggest:DESCRIPTION", null, "ru-RU"), + uk: client.translate("general/suggest:DESCRIPTION", null, "uk-UA"), + ru: client.translate("general/suggest:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addStringOption(option => option.setName("message") - .setDescription(client.translate("common:MESSAGE")) - .setDescriptionLocalizations({ - "uk": client.translate("common:MESSAGE", null, "uk-UA"), - "ru": client.translate("common:MESSAGE", null, "ru-RU"), - }) - .setRequired(true)), + .addStringOption(option => + option + .setName("message") + .setDescription(client.translate("common:MESSAGE")) + .setDescriptionLocalizations({ + uk: client.translate("common:MESSAGE", null, "uk-UA"), + ru: client.translate("common:MESSAGE", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -91,4 +94,4 @@ class Suggest extends BaseCommand { } } -module.exports = Suggest; \ No newline at end of file +module.exports = Suggest; diff --git a/commands/General/userinfo.js b/commands/General/userinfo.js index ac17915b..14fdcc59 100644 --- a/commands/General/userinfo.js +++ b/commands/General/userinfo.js @@ -12,16 +12,19 @@ class Userinfo extends BaseCommand { .setName("userinfo") .setDescription(client.translate("general/userinfo:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("general/userinfo:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("general/userinfo:DESCRIPTION", null, "ru-RU"), + uk: client.translate("general/userinfo:DESCRIPTION", null, "uk-UA"), + ru: client.translate("general/userinfo:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addUserOption(option => option.setName("user") - .setDescription(client.translate("common:USER")) - .setDescriptionLocalizations({ - "uk": client.translate("common:USER", null, "uk-UA"), - "ru": client.translate("common:USER", null, "ru-RU"), - })), + .addUserOption(option => + option + .setName("user") + .setDescription(client.translate("common:USER")) + .setDescriptionLocalizations({ + uk: client.translate("common:USER", null, "uk-UA"), + ru: client.translate("common:USER", null, "ru-RU"), + }), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -47,9 +50,11 @@ class Userinfo extends BaseCommand { name: `${member.user.getUsername()} (${member.id})`, iconURL: member.displayAvatarURL(), }) - .setThumbnail(member.displayAvatarURL({ - size: 512, - })) + .setThumbnail( + member.displayAvatarURL({ + size: 512, + }), + ) .addFields([ { name: ":man: " + interaction.translate("common:USERNAME"), @@ -88,9 +93,13 @@ class Userinfo extends BaseCommand { }, { name: client.customEmojis.roles + " " + interaction.translate("common:ROLES"), - value: (member.roles.size > 10 ? member.roles.cache.map(r => r).slice(0, 10).join(", ") + " " + interaction.translate("general/userinfo:MORE_ROLES", { - count: member.roles.cache.size - 10, - }) : (member.roles.cache.size < 1) ? interaction.translate("general/userinfo:NO_ROLE") : member.roles.cache.map(r => r).join(", ")), + value: + member.roles.size > 10 + ? member.roles.cache.map(r => r).filter(r => r.id !== interaction.guild.roles.everyone.id).slice(0, 10).join(", ") + " " + + interaction.translate("general/userinfo:MORE_ROLES", { + count: member.roles.cache.size - 10, + }) + : member.roles.cache.size < 1 ? interaction.translate("general/userinfo:NO_ROLE") : member.roles.cache.map(r => r).filter(r => r.id !== interaction.guild.roles.everyone.id).slice(0, 10).join(", "), inline: true, }, ]) @@ -124,4 +133,4 @@ class Userinfo extends BaseCommand { } } -module.exports = Userinfo; \ No newline at end of file +module.exports = Userinfo; diff --git a/commands/General/whois.js b/commands/General/whois.js index 46b97b03..4502c430 100644 --- a/commands/General/whois.js +++ b/commands/General/whois.js @@ -13,17 +13,20 @@ class Whois extends BaseCommand { .setName("whois") .setDescription(client.translate("general/whois:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("general/whois:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("general/whois:DESCRIPTION", null, "ru-RU"), + uk: client.translate("general/whois:DESCRIPTION", null, "uk-UA"), + ru: client.translate("general/whois:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(true) - .addStringOption(option => option.setName("ip") - .setDescription(client.translate("common:IP")) - .setDescriptionLocalizations({ - "uk": client.translate("common:IP", null, "uk-UA"), - "ru": client.translate("common:IP", null, "ru-RU"), - }) - .setRequired(true)), + .addStringOption(option => + option + .setName("ip") + .setDescription(client.translate("common:IP")) + .setDescriptionLocalizations({ + uk: client.translate("common:IP", null, "uk-UA"), + ru: client.translate("common:IP", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -51,9 +54,11 @@ class Whois extends BaseCommand { if (whois.status === "fail") return interaction.editReply({ content: interaction.translate("general/whois:ERROR", { ip }) }); const embed = new EmbedBuilder() - .setTitle(interaction.translate("general/whois:INFO_ABOUT", { - ip, - })) + .setTitle( + interaction.translate("general/whois:INFO_ABOUT", { + ip, + }), + ) .setFooter({ text: client.config.embed.footer, }) @@ -81,4 +86,4 @@ class Whois extends BaseCommand { } } -module.exports = Whois; \ No newline at end of file +module.exports = Whois; diff --git a/commands/IAT/checkjar.js b/commands/IAT/checkjar.js index 7c662e0f..05d783ac 100644 --- a/commands/IAT/checkjar.js +++ b/commands/IAT/checkjar.js @@ -14,8 +14,8 @@ class Checkjar extends BaseCommand { .setName("checkjar") .setDescription(client.translate("iat/checkjar:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("iat/checkjar:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("iat/checkjar:DESCRIPTION", null, "ru-RU"), + uk: client.translate("iat/checkjar:DESCRIPTION", null, "uk-UA"), + ru: client.translate("iat/checkjar:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false), aliases: [], @@ -47,7 +47,7 @@ class Checkjar extends BaseCommand { }, }).then(res => res.json()); const jar = clientInfo.jars[1]; - const jarTransactions = await fetch(`https://api.monobank.ua/personal/statement/${jar.id}/${Date.now() - (7 * 24 * 60 * 60 * 1000)}/${Date.now()}`, { + const jarTransactions = await fetch(`https://api.monobank.ua/personal/statement/${jar.id}/${Date.now() - 7 * 24 * 60 * 60 * 1000}/${Date.now()}`, { method: "GET", headers: { "X-Token": client.config.apiKeys.monobankApiKey, @@ -81,4 +81,4 @@ class Checkjar extends BaseCommand { } } -module.exports = Checkjar; \ No newline at end of file +module.exports = Checkjar; diff --git a/commands/Moderation/clear.js b/commands/Moderation/clear.js index 6114c237..bd5032bf 100644 --- a/commands/Moderation/clear.js +++ b/commands/Moderation/clear.js @@ -12,30 +12,39 @@ class Clear extends BaseCommand { .setName("clear") .setDescription(client.translate("moderation/clear:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("moderation/clear:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("moderation/clear:DESCRIPTION", null, "ru-RU"), + uk: client.translate("moderation/clear:DESCRIPTION", null, "uk-UA"), + ru: client.translate("moderation/clear:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages) - .addStringOption(option => option.setName("option") - .setDescription(client.translate("moderation/clear:OPTION")) - .setDescriptionLocalizations({ - "uk": client.translate("moderation/clear:OPTION", null, "uk-UA"), - "ru": client.translate("moderation/clear:OPTION", null, "ru-RU"), - }) - .setRequired(true)) - .addUserOption(option => option.setName("user") - .setDescription(client.translate("common:USER")) - .setDescriptionLocalizations({ - "uk": client.translate("common:USER", null, "uk-UA"), - "ru": client.translate("common:USER", null, "ru-RU"), - })) - .addStringOption(option => option.setName("id") - .setDescription(client.translate("common:USER_ID")) - .setDescriptionLocalizations({ - "uk": client.translate("common:USER_ID", null, "uk-UA"), - "ru": client.translate("common:USER_ID", null, "ru-RU"), - })), + .addStringOption(option => + option + .setName("option") + .setDescription(client.translate("moderation/clear:OPTION")) + .setDescriptionLocalizations({ + uk: client.translate("moderation/clear:OPTION", null, "uk-UA"), + ru: client.translate("moderation/clear:OPTION", null, "ru-RU"), + }) + .setRequired(true), + ) + .addUserOption(option => + option + .setName("user") + .setDescription(client.translate("common:USER")) + .setDescriptionLocalizations({ + uk: client.translate("common:USER", null, "uk-UA"), + ru: client.translate("common:USER", null, "ru-RU"), + }), + ) + .addStringOption(option => + option + .setName("id") + .setDescription(client.translate("common:USER_ID")) + .setDescriptionLocalizations({ + uk: client.translate("common:USER_ID", null, "uk-UA"), + ru: client.translate("common:USER_ID", null, "ru-RU"), + }), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -62,17 +71,10 @@ class Clear extends BaseCommand { user_id = interaction.options.getString("id"); if (option === "all") { - const row = new ActionRowBuilder() - .addComponents( - new ButtonBuilder() - .setCustomId("clear_confirm_yes") - .setLabel(interaction.translate("common:ACCEPT")) - .setStyle(ButtonStyle.Danger), - new ButtonBuilder() - .setCustomId("clear_confirm_no") - .setLabel(interaction.translate("common:CANCEL")) - .setStyle(ButtonStyle.Secondary), - ); + const row = new ActionRowBuilder().addComponents( + new ButtonBuilder().setCustomId("clear_confirm_yes").setLabel(interaction.translate("common:ACCEPT")).setStyle(ButtonStyle.Danger), + new ButtonBuilder().setCustomId("clear_confirm_no").setLabel(interaction.translate("common:CANCEL")).setStyle(ButtonStyle.Secondary), + ); await interaction.editReply({ content: interaction.translate("moderation/clear:ALL_CONFIRM"), @@ -80,7 +82,7 @@ class Clear extends BaseCommand { }); const filter = i => i.user.id === interaction.user.id; - const collector = interaction.channel.createMessageComponentCollector({ filter, idle: (15 * 1000) }); + const collector = interaction.channel.createMessageComponentCollector({ filter, idle: 15 * 1000 }); collector.on("collect", async i => { if (i.isButton()) { @@ -132,12 +134,15 @@ class Clear extends BaseCommand { if (user_id && member) return interaction.replyT("moderation/clear:REQUIRE_ID_USER", null, { edit: true }); if (user_id || member) messages = messages.filter(m => m.author.id === (user_id || member.id)); - interaction.channel.bulkDelete(messages.filter(m => !m.pinned), true); + interaction.channel.bulkDelete( + messages.filter(m => !m.pinned), + true, + ); if (member || user_id) { interaction.replyT("moderation/clear:CLEARED_MEMBER", { amount: `**${option}** ${client.functions.getNoun(option, interaction.translate("misc:NOUNS:MESSAGES:1"), interaction.translate("misc:NOUNS:MESSAGES:2"), interaction.translate("misc:NOUNS:MESSAGES:5"))}`, - user: member && member.user.getUsername() || user_id, + user: (member && member.user.getUsername()) || user_id, }, { edit: true }); } else { interaction.replyT("moderation/clear:CLEARED", { @@ -148,4 +153,4 @@ class Clear extends BaseCommand { } } -module.exports = Clear; \ No newline at end of file +module.exports = Clear; diff --git a/commands/Moderation/clearwarns.js b/commands/Moderation/clearwarns.js index 58fa7a34..e3689b0d 100644 --- a/commands/Moderation/clearwarns.js +++ b/commands/Moderation/clearwarns.js @@ -12,18 +12,21 @@ class Clearwarns extends BaseCommand { .setName("clearwarns") .setDescription(client.translate("moderation/clearwarns:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("moderation/clearwarns:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("moderation/clearwarns:DESCRIPTION", null, "ru-RU"), + uk: client.translate("moderation/clearwarns:DESCRIPTION", null, "uk-UA"), + ru: client.translate("moderation/clearwarns:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages) - .addUserOption(option => option.setName("user") - .setDescription(client.translate("common:USER")) - .setDescriptionLocalizations({ - "uk": client.translate("common:USER", null, "uk-UA"), - "ru": client.translate("common:USER", null, "ru-RU"), - }) - .setRequired(true)), + .addUserOption(option => + option + .setName("user") + .setDescription(client.translate("common:USER")) + .setDescriptionLocalizations({ + uk: client.translate("common:USER", null, "uk-UA"), + ru: client.translate("common:USER", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -60,4 +63,4 @@ class Clearwarns extends BaseCommand { } } -module.exports = Clearwarns; \ No newline at end of file +module.exports = Clearwarns; diff --git a/commands/Moderation/giveaway.js b/commands/Moderation/giveaway.js index 08513c47..4ea51d72 100644 --- a/commands/Moderation/giveaway.js +++ b/commands/Moderation/giveaway.js @@ -13,87 +13,116 @@ class Giveaway extends BaseCommand { .setName("giveaway") .setDescription(client.translate("moderation/giveaway:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("moderation/giveaway:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("moderation/giveaway:DESCRIPTION", null, "ru-RU"), + uk: client.translate("moderation/giveaway:DESCRIPTION", null, "uk-UA"), + ru: client.translate("moderation/giveaway:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages) - .addSubcommand(subcommand => subcommand.setName("create") - .setDescription(client.translate("moderation/giveaway:CREATE")) - .setDescriptionLocalizations({ - "uk": client.translate("moderation/giveaway:CREATE", null, "uk-UA"), - "ru": client.translate("moderation/giveaway:CREATE", null, "ru-RU"), - }) - .addStringOption(option => option.setName("duration") - .setDescription(client.translate("common:DURATION")) + .addSubcommand(subcommand => + subcommand + .setName("create") + .setDescription(client.translate("moderation/giveaway:CREATE")) .setDescriptionLocalizations({ - "uk": client.translate("common:DURATION", null, "uk-UA"), - "ru": client.translate("common:DURATION", null, "ru-RU"), + uk: client.translate("moderation/giveaway:CREATE", null, "uk-UA"), + ru: client.translate("moderation/giveaway:CREATE", null, "ru-RU"), }) - .setRequired(true)) - .addIntegerOption(option => option.setName("winners_count") - .setDescription(client.translate("moderation/giveaway:WINNERS_COUNT")) - .setDescriptionLocalizations({ - "uk": client.translate("moderation/giveaway:WINNERS_COUNT", null, "uk-UA"), - "ru": client.translate("moderation/giveaway:WINNERS_COUNT", null, "ru-RU"), - }) - .setRequired(true)) - .addStringOption(option => option.setName("prize") - .setDescription(client.translate("moderation/giveaway:PRIZE")) - .setDescriptionLocalizations({ - "uk": client.translate("moderation/giveaway:PRIZE", null, "uk-UA"), - "ru": client.translate("moderation/giveaway:PRIZE", null, "ru-RU"), - }) - .setRequired(true)) - .addBooleanOption(option => option.setName("isdrop") - .setDescription(client.translate("moderation/giveaway:ISDROP")) - .setDescriptionLocalizations({ - "uk": client.translate("moderation/giveaway:ISDROP", null, "uk-UA"), - "ru": client.translate("moderation/giveaway:ISDROP", null, "ru-RU"), - }) - .setRequired(true)), + .addStringOption(option => + option + .setName("duration") + .setDescription(client.translate("common:DURATION")) + .setDescriptionLocalizations({ + uk: client.translate("common:DURATION", null, "uk-UA"), + ru: client.translate("common:DURATION", null, "ru-RU"), + }) + .setRequired(true), + ) + .addIntegerOption(option => + option + .setName("winners_count") + .setDescription(client.translate("moderation/giveaway:WINNERS_COUNT")) + .setDescriptionLocalizations({ + uk: client.translate("moderation/giveaway:WINNERS_COUNT", null, "uk-UA"), + ru: client.translate("moderation/giveaway:WINNERS_COUNT", null, "ru-RU"), + }) + .setRequired(true), + ) + .addStringOption(option => + option + .setName("prize") + .setDescription(client.translate("moderation/giveaway:PRIZE")) + .setDescriptionLocalizations({ + uk: client.translate("moderation/giveaway:PRIZE", null, "uk-UA"), + ru: client.translate("moderation/giveaway:PRIZE", null, "ru-RU"), + }) + .setRequired(true), + ) + .addBooleanOption(option => + option + .setName("isdrop") + .setDescription(client.translate("moderation/giveaway:ISDROP")) + .setDescriptionLocalizations({ + uk: client.translate("moderation/giveaway:ISDROP", null, "uk-UA"), + ru: client.translate("moderation/giveaway:ISDROP", null, "ru-RU"), + }) + .setRequired(true), + ), ) - .addSubcommand(subcommand => subcommand.setName("reroll") - .setDescription(client.translate("moderation/giveaway:REROLL")) - .setDescriptionLocalizations({ - "uk": client.translate("moderation/giveaway:REROLL", null, "uk-UA"), - "ru": client.translate("moderation/giveaway:REROLL", null, "ru-RU"), - }) - .addStringOption(option => option.setName("giveaway_id") - .setDescription(client.translate("moderation/giveaway:GIVEAWAY_ID")) + .addSubcommand(subcommand => + subcommand + .setName("reroll") + .setDescription(client.translate("moderation/giveaway:REROLL")) .setDescriptionLocalizations({ - "uk": client.translate("moderation/giveaway:GIVEAWAY_ID", null, "uk-UA"), - "ru": client.translate("moderation/giveaway:GIVEAWAY_ID", null, "ru-RU"), + uk: client.translate("moderation/giveaway:REROLL", null, "uk-UA"), + ru: client.translate("moderation/giveaway:REROLL", null, "ru-RU"), }) - .setRequired(true)), + .addStringOption(option => + option + .setName("giveaway_id") + .setDescription(client.translate("moderation/giveaway:GIVEAWAY_ID")) + .setDescriptionLocalizations({ + uk: client.translate("moderation/giveaway:GIVEAWAY_ID", null, "uk-UA"), + ru: client.translate("moderation/giveaway:GIVEAWAY_ID", null, "ru-RU"), + }) + .setRequired(true), + ), ) - .addSubcommand(subcommand => subcommand.setName("end") - .setDescription(client.translate("moderation/giveaway:END")) - .setDescriptionLocalizations({ - "uk": client.translate("moderation/giveaway:END", null, "uk-UA"), - "ru": client.translate("moderation/giveaway:END", null, "ru-RU"), - }) - .addStringOption(option => option.setName("giveaway_id") - .setDescription(client.translate("moderation/giveaway:GIVEAWAY_ID")) + .addSubcommand(subcommand => + subcommand + .setName("end") + .setDescription(client.translate("moderation/giveaway:END")) .setDescriptionLocalizations({ - "uk": client.translate("moderation/giveaway:GIVEAWAY_ID", null, "uk-UA"), - "ru": client.translate("moderation/giveaway:GIVEAWAY_ID", null, "ru-RU"), + uk: client.translate("moderation/giveaway:END", null, "uk-UA"), + ru: client.translate("moderation/giveaway:END", null, "ru-RU"), }) - .setRequired(true)), + .addStringOption(option => + option + .setName("giveaway_id") + .setDescription(client.translate("moderation/giveaway:GIVEAWAY_ID")) + .setDescriptionLocalizations({ + uk: client.translate("moderation/giveaway:GIVEAWAY_ID", null, "uk-UA"), + ru: client.translate("moderation/giveaway:GIVEAWAY_ID", null, "ru-RU"), + }) + .setRequired(true), + ), ) - .addSubcommand(subcommand => subcommand.setName("delete") - .setDescription(client.translate("moderation/giveaway:DELETE")) - .setDescriptionLocalizations({ - "uk": client.translate("moderation/giveaway:DELETE", null, "uk-UA"), - "ru": client.translate("moderation/giveaway:DELETE", null, "ru-RU"), - }) - .addStringOption(option => option.setName("giveaway_id") - .setDescription(client.translate("moderation/giveaway:GIVEAWAY_ID")) + .addSubcommand(subcommand => + subcommand + .setName("delete") + .setDescription(client.translate("moderation/giveaway:DELETE")) .setDescriptionLocalizations({ - "uk": client.translate("moderation/giveaway:GIVEAWAY_ID", null, "uk-UA"), - "ru": client.translate("moderation/giveaway:GIVEAWAY_ID", null, "ru-RU"), + uk: client.translate("moderation/giveaway:DELETE", null, "uk-UA"), + ru: client.translate("moderation/giveaway:DELETE", null, "ru-RU"), }) - .setRequired(true)), + .addStringOption(option => + option + .setName("giveaway_id") + .setDescription(client.translate("moderation/giveaway:GIVEAWAY_ID")) + .setDescriptionLocalizations({ + uk: client.translate("moderation/giveaway:GIVEAWAY_ID", null, "uk-UA"), + ru: client.translate("moderation/giveaway:GIVEAWAY_ID", null, "ru-RU"), + }) + .setRequired(true), + ), ), aliases: [], dirname: __dirname, @@ -129,44 +158,49 @@ class Giveaway extends BaseCommand { const prize = interaction.options.getString("prize"); const isdrop = interaction.options.getBoolean("isdrop"); - client.giveawaysManager.start(interaction.channel, { - duration: ms(duration), - winnerCount: winnersCount, - prize: prize, - hostedBy: interaction.user, - isDrop: isdrop, - messages: { - giveaway: interaction.translate("moderation/giveaway:TITLE"), - giveawayEnded: interaction.translate("moderation/giveaway:ENDED"), - timeRemaining: interaction.translate("moderation/giveaway:TIME_REMAINING"), - inviteToParticipate: interaction.translate("moderation/giveaway:INVITE_PARTICIPATE"), - winMessage: interaction.translate("moderation/giveaway:WIN_MESSAGE"), - drawing: interaction.translate("moderation/giveaway:DRAWING"), - dropMessage: interaction.translate("moderation/giveaway:DROP"), - embedFooter: interaction.translate("moderation/giveaway:FOOTER"), - noWinner: interaction.translate("moderation/giveaway:NO_WINNER"), - winners: interaction.translate("moderation/giveaway:WINNERS"), - endedAt: interaction.translate("moderation/giveaway:END_AT"), - hostedBy: interaction.translate("moderation/giveaway:HOSTED_BY"), - }, - }).then(() => { - return interaction.success("moderation/giveaway:GIVEAWAY_CREATED", null, { ephemeral: true }); - }); + client.giveawaysManager + .start(interaction.channel, { + duration: ms(duration), + winnerCount: winnersCount, + prize: prize, + hostedBy: interaction.user, + isDrop: isdrop, + messages: { + giveaway: interaction.translate("moderation/giveaway:TITLE"), + giveawayEnded: interaction.translate("moderation/giveaway:ENDED"), + timeRemaining: interaction.translate("moderation/giveaway:TIME_REMAINING"), + inviteToParticipate: interaction.translate("moderation/giveaway:INVITE_PARTICIPATE"), + winMessage: interaction.translate("moderation/giveaway:WIN_MESSAGE"), + drawing: interaction.translate("moderation/giveaway:DRAWING"), + dropMessage: interaction.translate("moderation/giveaway:DROP"), + embedFooter: interaction.translate("moderation/giveaway:FOOTER"), + noWinner: interaction.translate("moderation/giveaway:NO_WINNER"), + winners: interaction.translate("moderation/giveaway:WINNERS"), + endedAt: interaction.translate("moderation/giveaway:END_AT"), + hostedBy: interaction.translate("moderation/giveaway:HOSTED_BY"), + }, + }) + .then(() => { + return interaction.success("moderation/giveaway:GIVEAWAY_CREATED", null, { ephemeral: true }); + }); } else if (command === "reroll") { const giveaway_id = interaction.options.getString("giveaway_id"); - client.giveawaysManager.reroll(giveaway_id, { - messages: { - congrat: interaction.translate("moderation/giveaway:REROLL_CONGRAT"), - error: interaction.translate("moderation/giveaway:REROLL_ERROR"), - }, - }).then(() => { - return interaction.success("moderation/giveaway:GIVEAWAY_REROLLED"); - }).catch(() => { - return interaction.error("moderation/giveaway:NOT_FOUND_ENDED", { - messageId: giveaway_id, - }, { ephemeral: true }); - }); + client.giveawaysManager + .reroll(giveaway_id, { + messages: { + congrat: interaction.translate("moderation/giveaway:REROLL_CONGRAT"), + error: interaction.translate("moderation/giveaway:REROLL_ERROR"), + }, + }) + .then(() => { + return interaction.success("moderation/giveaway:GIVEAWAY_REROLLED"); + }) + .catch(() => { + return interaction.error("moderation/giveaway:NOT_FOUND_ENDED", { + messageId: giveaway_id, + }, { ephemeral: true }); + }); } else if (command === "end") { const giveaway_id = interaction.options.getString("giveaway_id"); @@ -181,15 +215,18 @@ class Giveaway extends BaseCommand { } else if (command === "delete") { const giveaway_id = interaction.options.getString("giveaway_id"); - client.giveawaysManager.delete(giveaway_id).then(() => { - return interaction.success("moderation/giveaway:GIVEAWAY_DELETED"); - }).catch(() => { - return interaction.error("moderation/giveaway:NOT_FOUND", { - messageId: giveaway_id, - }, { ephemeral: true }); - }); + client.giveawaysManager + .delete(giveaway_id) + .then(() => { + return interaction.success("moderation/giveaway:GIVEAWAY_DELETED"); + }) + .catch(() => { + return interaction.error("moderation/giveaway:NOT_FOUND", { + messageId: giveaway_id, + }, { ephemeral: true }); + }); } } } -module.exports = Giveaway; \ No newline at end of file +module.exports = Giveaway; diff --git a/commands/Moderation/poll.js b/commands/Moderation/poll.js index ffa94a1e..09fccbe4 100644 --- a/commands/Moderation/poll.js +++ b/commands/Moderation/poll.js @@ -12,18 +12,21 @@ class Poll extends BaseCommand { .setName("poll") .setDescription(client.translate("moderation/poll:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("moderation/poll:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("moderation/poll:DESCRIPTION", null, "ru-RU"), + uk: client.translate("moderation/poll:DESCRIPTION", null, "uk-UA"), + ru: client.translate("moderation/poll:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages) - .addStringOption(option => option.setName("question") - .setDescription(client.translate("moderation/poll:QUESTION")) - .setDescriptionLocalizations({ - "uk": client.translate("moderation/poll:QUESTION", null, "uk-UA"), - "ru": client.translate("moderation/poll:QUESTION", null, "ru-RU"), - }) - .setRequired(true)), + .addStringOption(option => + option + .setName("question") + .setDescription(client.translate("moderation/poll:QUESTION")) + .setDescriptionLocalizations({ + uk: client.translate("moderation/poll:QUESTION", null, "uk-UA"), + ru: client.translate("moderation/poll:QUESTION", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -45,26 +48,12 @@ class Poll extends BaseCommand { async execute(client, interaction) { const question = interaction.options.getString("question"); - const row = new ActionRowBuilder() - .addComponents( - new ButtonBuilder() - .setCustomId("poll_everyone") - .setLabel("@everyone") - .setStyle(ButtonStyle.Primary), - new ButtonBuilder() - .setCustomId("poll_here") - .setLabel("@here") - .setStyle(ButtonStyle.Primary), - new ButtonBuilder() - .setCustomId("poll_nothing") - .setLabel(interaction.translate("moderation/poll:NOTHING")) - .setStyle(ButtonStyle.Primary), - new ButtonBuilder() - .setCustomId("poll_cancel") - .setLabel(interaction.translate("common:CANCEL")) - .setStyle(ButtonStyle.Danger), - ); - + const row = new ActionRowBuilder().addComponents( + new ButtonBuilder().setCustomId("poll_everyone").setLabel("@everyone").setStyle(ButtonStyle.Primary), + new ButtonBuilder().setCustomId("poll_here").setLabel("@here").setStyle(ButtonStyle.Primary), + new ButtonBuilder().setCustomId("poll_nothing").setLabel(interaction.translate("moderation/poll:NOTHING")).setStyle(ButtonStyle.Primary), + new ButtonBuilder().setCustomId("poll_cancel").setLabel(interaction.translate("common:CANCEL")).setStyle(ButtonStyle.Danger), + ); await interaction.reply({ content: interaction.translate("moderation/poll:SELECT_MENTION"), @@ -74,7 +63,7 @@ class Poll extends BaseCommand { let mention = null; const filter = i => i.user.id === interaction.user.id; - const collector = interaction.channel.createMessageComponentCollector({ filter, idle: (15 * 1000) }); + const collector = interaction.channel.createMessageComponentCollector({ filter, idle: 15 * 1000 }); collector.on("collect", async i => { if (i.isButton()) { @@ -137,4 +126,4 @@ class Poll extends BaseCommand { } } -module.exports = Poll; \ No newline at end of file +module.exports = Poll; diff --git a/commands/Moderation/unban.js b/commands/Moderation/unban.js index 77d3631d..fbac6653 100644 --- a/commands/Moderation/unban.js +++ b/commands/Moderation/unban.js @@ -12,18 +12,21 @@ class Unban extends BaseCommand { .setName("unban") .setDescription(client.translate("moderation/unban:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("moderation/unban:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("moderation/unban:DESCRIPTION", null, "ru-RU"), + uk: client.translate("moderation/unban:DESCRIPTION", null, "uk-UA"), + ru: client.translate("moderation/unban:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages) - .addStringOption(option => option.setName("user_id") - .setDescription(client.translate("common:USER_ID")) - .setDescriptionLocalizations({ - "uk": client.translate("common:USER_ID", null, "uk-UA"), - "ru": client.translate("common:USER_ID", null, "ru-RU"), - }) - .setRequired(true)), + .addStringOption(option => + option + .setName("user_id") + .setDescription(client.translate("common:USER_ID")) + .setDescriptionLocalizations({ + uk: client.translate("common:USER_ID", null, "uk-UA"), + ru: client.translate("common:USER_ID", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -56,4 +59,4 @@ class Unban extends BaseCommand { } } -module.exports = Unban; \ No newline at end of file +module.exports = Unban; diff --git a/commands/Moderation/warn.js b/commands/Moderation/warn.js index f800d1f0..cf86f08a 100644 --- a/commands/Moderation/warn.js +++ b/commands/Moderation/warn.js @@ -8,11 +8,7 @@ class Warn extends BaseCommand { */ constructor() { super({ - command: new ContextMenuCommandBuilder() - .setName("warn") - .setType(ApplicationCommandType.User) - .setDMPermission(false) - .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages), + command: new ContextMenuCommandBuilder().setName("warn").setType(ApplicationCommandType.User).setDMPermission(false).setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages), aliases: [], dirname: __dirname, ownerOnly: false, @@ -47,7 +43,9 @@ class Warn extends BaseCommand { const modal = new ModalBuilder() .setCustomId("warn_modal") - .setTitle(interaction.translate("moderation/warn:MODAL_TITLE", { nickname: member.user.getUsername() }).normalize("NFKD")); + .setTitle(interaction.translate("moderation/warn:MODAL_TITLE", { + nickname: member.user.getUsername(), + }).normalize("NFKD")); const reasonInput = new TextInputBuilder() .setCustomId("warn_reason") @@ -61,15 +59,17 @@ class Warn extends BaseCommand { await interaction.showModal(modal); - const submitted = await interaction.awaitModalSubmit({ - time: (2 * 60 * 1000), - filter: i => i.user.id === interaction.member.id && i.customId === "warn_modal", - }).catch(() => { - interaction.followUp({ - content: interaction.translate("misc:TIMED_OUT"), - ephemeral: true, + const submitted = await interaction + .awaitModalSubmit({ + time: 2 * 60 * 1000, + filter: i => i.user.id === interaction.member.id && i.customId === "warn_modal", + }) + .catch(() => { + interaction.followUp({ + content: interaction.translate("misc:TIMED_OUT"), + ephemeral: true, + }); }); - }); if (submitted) { const reason = submitted.fields.getTextInputValue("warn_reason"); @@ -85,22 +85,21 @@ class Warn extends BaseCommand { reason, }; - const embed = new EmbedBuilder() - .addFields([ - { - name: interaction.translate("common:USER"), - value: `\`${member.user.getUsername()}\` (${member.user.toString()})`, - }, - { - name: interaction.translate("common:MODERATOR"), - value: `\`${interaction.user.getUsername()}\` (${interaction.user.toString()})`, - }, - { - name: interaction.translate("common:REASON"), - value: reason, - inline: true, - }, - ]); + const embed = new EmbedBuilder().addFields([ + { + name: interaction.translate("common:USER"), + value: `\`${member.user.getUsername()}\` (${member.user.toString()})`, + }, + { + name: interaction.translate("common:MODERATOR"), + value: `\`${interaction.user.getUsername()}\` (${interaction.user.toString()})`, + }, + { + name: interaction.translate("common:REASON"), + value: reason, + inline: true, + }, + ]); /* if (banCount) { if (sanctions >= banCount) { @@ -200,4 +199,4 @@ class Warn extends BaseCommand { } } -module.exports = Warn; \ No newline at end of file +module.exports = Warn; diff --git a/commands/Moderation/warns.js b/commands/Moderation/warns.js index 0edf9fe2..647b9882 100644 --- a/commands/Moderation/warns.js +++ b/commands/Moderation/warns.js @@ -12,18 +12,21 @@ class Warns extends BaseCommand { .setName("warns") .setDescription(client.translate("moderation/warns:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("moderation/warns:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("moderation/warns:DESCRIPTION", null, "ru-RU"), + uk: client.translate("moderation/warns:DESCRIPTION", null, "uk-UA"), + ru: client.translate("moderation/warns:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) .setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages) - .addUserOption(option => option.setName("user") - .setDescription(client.translate("common:USER")) - .setDescriptionLocalizations({ - "uk": client.translate("common:USER", null, "uk-UA"), - "ru": client.translate("common:USER", null, "ru-RU"), - }) - .setRequired(true)), + .addUserOption(option => + option + .setName("user") + .setDescription(client.translate("common:USER")) + .setDescriptionLocalizations({ + uk: client.translate("common:USER", null, "uk-UA"), + ru: client.translate("common:USER", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -56,10 +59,7 @@ class Warns extends BaseCommand { name: interaction.translate("moderation/warns:SANCTIONS_OF", { member: member.user.getUsername(), }), - iconURL: member.displayAvatarURL({ - extension: "png", - size: 512, - }), + iconURL: member.displayAvatarURL(), }) .setColor(client.config.embed.color) .setFooter({ @@ -67,9 +67,11 @@ class Warns extends BaseCommand { }); if (memberData.sanctions.length === 0) { - embed.setDescription(interaction.translate("moderation/warns:NO_SANCTIONS", { - member: member.user.getUsername(), - })); + embed.setDescription( + interaction.translate("moderation/warns:NO_SANCTIONS", { + member: member.user.getUsername(), + }), + ); return interaction.reply({ embeds: [embed], }); @@ -84,10 +86,11 @@ class Warns extends BaseCommand { ]); }); } + interaction.reply({ embeds: [embed], }); } } -module.exports = Warns; \ No newline at end of file +module.exports = Warns; diff --git a/commands/Music/back.js b/commands/Music/back.js index fc34bc8d..9a5a04a7 100644 --- a/commands/Music/back.js +++ b/commands/Music/back.js @@ -12,8 +12,8 @@ class Back extends BaseCommand { .setName("back") .setDescription(client.translate("music/back:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("music/back:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("music/back:DESCRIPTION", null, "ru-RU"), + uk: client.translate("music/back:DESCRIPTION", null, "uk-UA"), + ru: client.translate("music/back:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false), aliases: [], @@ -47,4 +47,4 @@ class Back extends BaseCommand { } } -module.exports = Back; \ No newline at end of file +module.exports = Back; diff --git a/commands/Music/clips.js b/commands/Music/clips.js index 538f8f18..68d5943a 100644 --- a/commands/Music/clips.js +++ b/commands/Music/clips.js @@ -14,18 +14,21 @@ class Clips extends BaseCommand { .setName("clips") .setDescription(client.translate("music/clips:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("music/clips:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("music/clips:DESCRIPTION", null, "ru-RU"), + uk: client.translate("music/clips:DESCRIPTION", null, "uk-UA"), + ru: client.translate("music/clips:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addStringOption(option => option.setName("query") - .setDescription(client.translate("music/clips:QUERY")) - .setDescriptionLocalizations({ - "uk": client.translate("music/clips:QUERY", null, "uk-UA"), - "ru": client.translate("music/clips:QUERY", null, "ru-RU"), - }) - .setRequired(true) - .setAutocomplete(true)), + .addStringOption(option => + option + .setName("query") + .setDescription(client.translate("music/clips:QUERY")) + .setDescriptionLocalizations({ + uk: client.translate("music/clips:QUERY", null, "uk-UA"), + ru: client.translate("music/clips:QUERY", null, "ru-RU"), + }) + .setRequired(true) + .setAutocomplete(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -92,9 +95,9 @@ class Clips extends BaseCommand { results.slice(0, 25).map(file => ({ name: file.substring(0, file.length - 4), value: `./clips/${file}`, - }), - )); + })), + ); } } -module.exports = Clips; \ No newline at end of file +module.exports = Clips; diff --git a/commands/Music/loop.js b/commands/Music/loop.js index bd1e2cf1..4b625aa9 100644 --- a/commands/Music/loop.js +++ b/commands/Music/loop.js @@ -13,23 +13,26 @@ class Loop extends BaseCommand { .setName("loop") .setDescription(client.translate("music/loop:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("music/loop:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("music/loop:DESCRIPTION", null, "ru-RU"), + uk: client.translate("music/loop:DESCRIPTION", null, "uk-UA"), + ru: client.translate("music/loop:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addStringOption(option => option.setName("option") - .setDescription(client.translate("music/loop:OPTION")) - .setDescriptionLocalizations({ - "uk": client.translate("music/loop:OPTION", null, "uk-UA"), - "ru": client.translate("music/loop:OPTION", null, "ru-RU"), - }) - .setRequired(true) - .setChoices( - { name: client.translate("music/loop:AUTOPLAY"), value: "3" }, - { name: client.translate("music/loop:QUEUE"), value: "2" }, - { name: client.translate("music/loop:TRACK"), value: "1" }, - { name: client.translate("music/loop:DISABLE"), value: "0" }, - )), + .addStringOption(option => + option + .setName("option") + .setDescription(client.translate("music/loop:OPTION")) + .setDescriptionLocalizations({ + uk: client.translate("music/loop:OPTION", null, "uk-UA"), + ru: client.translate("music/loop:OPTION", null, "ru-RU"), + }) + .setRequired(true) + .setChoices( + { name: client.translate("music/loop:AUTOPLAY"), value: "3" }, + { name: client.translate("music/loop:QUEUE"), value: "2" }, + { name: client.translate("music/loop:TRACK"), value: "1" }, + { name: client.translate("music/loop:DISABLE"), value: "0" }, + ), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -56,18 +59,12 @@ class Loop extends BaseCommand { if (!queue) return interaction.error("music/play:NOT_PLAYING", null, { edit: true }); const type = interaction.options.getString("option"), - mode = type === "3" ? QueueRepeatMode.AUTOPLAY : - type === "2" ? QueueRepeatMode.QUEUE : - type === "1" ? QueueRepeatMode.TRACK : QueueRepeatMode.OFF; + mode = type === "3" ? QueueRepeatMode.AUTOPLAY : type === "2" ? QueueRepeatMode.QUEUE : type === "1" ? QueueRepeatMode.TRACK : QueueRepeatMode.OFF; queue.setRepeatMode(mode); - interaction.success(`music/loop:${ - type === "3" ? "AUTOPLAY_ENABLED" : - type === "2" ? "QUEUE_ENABLED" : - type === "1" ? "TRACK_ENABLED" : "LOOP_DISABLED" - }`); + interaction.success(`music/loop:${type === "3" ? "AUTOPLAY_ENABLED" : type === "2" ? "QUEUE_ENABLED" : type === "1" ? "TRACK_ENABLED" : "LOOP_DISABLED"}`); } } -module.exports = Loop; \ No newline at end of file +module.exports = Loop; diff --git a/commands/Music/nowplaying.js b/commands/Music/nowplaying.js index 0c627476..84fadfb8 100644 --- a/commands/Music/nowplaying.js +++ b/commands/Music/nowplaying.js @@ -13,8 +13,8 @@ class Nowplaying extends BaseCommand { .setName("nowplaying") .setDescription(client.translate("music/nowplaying:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("music/nowplaying:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("music/nowplaying:DESCRIPTION", null, "ru-RU"), + uk: client.translate("music/nowplaying:DESCRIPTION", null, "uk-UA"), + ru: client.translate("music/nowplaying:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false), aliases: [], @@ -77,9 +77,13 @@ class Nowplaying extends BaseCommand { { name: "\u200b", value: `${interaction.translate("music/nowplaying:REPEAT")}: \`${ - queue.repeatMode === QueueRepeatMode.AUTOPLAY ? interaction.translate("music/nowplaying:AUTOPLAY") : - queue.repeatMode === QueueRepeatMode.QUEUE ? interaction.translate("music/nowplaying:QUEUE") : - queue.repeatMode === QueueRepeatMode.TRACK ? interaction.translate("music/nowplaying:TRACK") : interaction.translate("common:DISABLED") + queue.repeatMode === QueueRepeatMode.AUTOPLAY + ? interaction.translate("music/nowplaying:AUTOPLAY") + : queue.repeatMode === QueueRepeatMode.QUEUE + ? interaction.translate("music/nowplaying:QUEUE") + : queue.repeatMode === QueueRepeatMode.TRACK + ? interaction.translate("music/nowplaying:TRACK") + : interaction.translate("common:DISABLED") }\``, }, ]) @@ -95,4 +99,4 @@ class Nowplaying extends BaseCommand { } } -module.exports = Nowplaying; \ No newline at end of file +module.exports = Nowplaying; diff --git a/commands/Music/play.js b/commands/Music/play.js index 2df9f755..c370148c 100644 --- a/commands/Music/play.js +++ b/commands/Music/play.js @@ -12,18 +12,21 @@ class Play extends BaseCommand { .setName("play") .setDescription(client.translate("music/play:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("music/play:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("music/play:DESCRIPTION", null, "ru-RU"), + uk: client.translate("music/play:DESCRIPTION", null, "uk-UA"), + ru: client.translate("music/play:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addStringOption(option => option.setName("query") - .setDescription(client.translate("music/play:QUERY")) - .setDescriptionLocalizations({ - "uk": client.translate("music/play:QUERY", null, "uk-UA"), - "ru": client.translate("music/play:QUERY", null, "ru-RU"), - }) - .setRequired(true) - .setAutocomplete(true)), + .addStringOption(option => + option + .setName("query") + .setDescription(client.translate("music/play:QUERY")) + .setDescriptionLocalizations({ + uk: client.translate("music/play:QUERY", null, "uk-UA"), + ru: client.translate("music/play:QUERY", null, "ru-RU"), + }) + .setRequired(true) + .setAutocomplete(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -96,11 +99,11 @@ class Play extends BaseCommand { return interaction.respond( results.tracks.slice(0, 10).map(track => ({ - name: (`${track.author} - ${track.title}`.length >= 100 & `${track.author} - ${track.title}`.slice(0, 90) + "...") || `${track.author} - ${track.title}`, + name: (`${track.author} - ${track.title}`.length >= 100) & (`${track.author} - ${track.title}`.slice(0, 90) + "...") || `${track.author} - ${track.title}`, value: track.url, - }), - )); + })), + ); } } -module.exports = Play; \ No newline at end of file +module.exports = Play; diff --git a/commands/Music/queue.js b/commands/Music/queue.js index 4f2bc064..5c82460c 100644 --- a/commands/Music/queue.js +++ b/commands/Music/queue.js @@ -13,8 +13,8 @@ class Queue extends BaseCommand { .setName("queue") .setDescription(client.translate("music/queue:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("music/queue:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("music/queue:DESCRIPTION", null, "ru-RU"), + uk: client.translate("music/queue:DESCRIPTION", null, "uk-UA"), + ru: client.translate("music/queue:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false), aliases: [], @@ -42,29 +42,12 @@ class Queue extends BaseCommand { let currentPage = 0; let embeds = generateQueueEmbeds(interaction, queue); - const row = new ActionRowBuilder() - .addComponents( - new ButtonBuilder() - .setCustomId("queue_prev_page") - .setLabel(interaction.translate("music/queue:PREV_PAGE")) - .setStyle(ButtonStyle.Primary) - .setEmoji("⬅️"), - new ButtonBuilder() - .setCustomId("queue_next_page") - .setLabel(interaction.translate("music/queue:NEXT_PAGE")) - .setStyle(ButtonStyle.Primary) - .setEmoji("➡️"), - new ButtonBuilder() - .setCustomId("queue_jump_page") - .setLabel(interaction.translate("music/queue:JUMP_PAGE")) - .setStyle(ButtonStyle.Secondary) - .setEmoji("↗️"), - new ButtonBuilder() - .setCustomId("queue_stop") - .setLabel(interaction.translate("common:CANCEL")) - .setStyle(ButtonStyle.Danger) - .setEmoji("⏹️"), - ); + const row = new ActionRowBuilder().addComponents( + new ButtonBuilder().setCustomId("queue_prev_page").setLabel(interaction.translate("music/queue:PREV_PAGE")).setStyle(ButtonStyle.Primary).setEmoji("⬅️"), + new ButtonBuilder().setCustomId("queue_next_page").setLabel(interaction.translate("music/queue:NEXT_PAGE")).setStyle(ButtonStyle.Primary).setEmoji("➡️"), + new ButtonBuilder().setCustomId("queue_jump_page").setLabel(interaction.translate("music/queue:JUMP_PAGE")).setStyle(ButtonStyle.Secondary).setEmoji("↗️"), + new ButtonBuilder().setCustomId("queue_stop").setLabel(interaction.translate("common:CANCEL")).setStyle(ButtonStyle.Danger).setEmoji("⏹️"), + ); await interaction.reply({ content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`, @@ -73,7 +56,7 @@ class Queue extends BaseCommand { }); const filter = i => i.user.id === interaction.user.id; - const collector = interaction.channel.createMessageComponentCollector({ filter, idle: (20 * 1000) }); + const collector = interaction.channel.createMessageComponentCollector({ filter, idle: 20 * 1000 }); collector.on("collect", async i => { if (i.isButton()) { @@ -116,7 +99,7 @@ class Queue extends BaseCommand { return res.author.id === interaction.user.id && !isNaN(res.content); }; - interaction.channel.awaitMessages({ filter, max: 1, time: (10 * 1000) }).then(collected => { + interaction.channel.awaitMessages({ filter, max: 1, time: 10 * 1000 }).then(collected => { if (embeds[collected.first().content - 1]) { currentPage = collected.first().content - 1; interaction.editReply({ @@ -168,11 +151,19 @@ function generateQueueEmbeds(interaction, queue) { .setTitle(interaction.translate("music/nowplaying:CURRENTLY_PLAYING")) .setThumbnail(currentTrack.thumbnail) .setColor(interaction.client.config.embed.color) - .setDescription(`${interaction.translate("music/nowplaying:REPEAT")}: \`${ - queue.repeatMode === QueueRepeatMode.AUTOPLAY ? interaction.translate("music/nowplaying:AUTOPLAY") : - queue.repeatMode === QueueRepeatMode.QUEUE ? interaction.translate("music/nowplaying:QUEUE") : - queue.repeatMode === QueueRepeatMode.TRACK ? interaction.translate("music/nowplaying:TRACK") : interaction.translate("common:DISABLED") - }\`\n${currentTrack.url.startsWith("./clips") ? `${currentTrack.title} (clips)` : `[${currentTrack.title}](${currentTrack.url})`}\n> ${interaction.translate("music/queue:ADDED")} ${currentTrack.requestedBy}\n\n**${interaction.translate("music/queue:NEXT")}**\n${interaction.translate("music/queue:NO_QUEUE")}`) + .setDescription( + `${interaction.translate("music/nowplaying:REPEAT")}: \`${ + queue.repeatMode === QueueRepeatMode.AUTOPLAY + ? interaction.translate("music/nowplaying:AUTOPLAY") + : queue.repeatMode === QueueRepeatMode.QUEUE + ? interaction.translate("music/nowplaying:QUEUE") + : queue.repeatMode === QueueRepeatMode.TRACK + ? interaction.translate("music/nowplaying:TRACK") + : interaction.translate("common:DISABLED") + }\`\n${currentTrack.url.startsWith("./clips") ? `${currentTrack.title} (clips)` : `[${currentTrack.title}](${currentTrack.url})`}\n> ${interaction.translate("music/queue:ADDED")} ${ + currentTrack.requestedBy + }\n\n**${interaction.translate("music/queue:NEXT")}**\n${interaction.translate("music/queue:NO_QUEUE")}`, + ) .setTimestamp(); embeds.push(embed); @@ -190,11 +181,19 @@ function generateQueueEmbeds(interaction, queue) { .setTitle(interaction.translate("music/nowplaying:CURRENTLY_PLAYING")) .setThumbnail(currentTrack.thumbnail) .setColor(interaction.client.config.embed.color) - .setDescription(`${interaction.translate("music/nowplaying:REPEAT")}: \`${ - queue.repeatMode === QueueRepeatMode.AUTOPLAY ? interaction.translate("music/nowplaying:AUTOPLAY") : - queue.repeatMode === QueueRepeatMode.QUEUE ? interaction.translate("music/nowplaying:QUEUE") : - queue.repeatMode === QueueRepeatMode.TRACK ? interaction.translate("music/nowplaying:TRACK") : interaction.translate("common:DISABLED") - }\`\n${currentTrack.url.startsWith("./clips") ? `${currentTrack.title} (clips)` : `[${currentTrack.title}](${currentTrack.url})`}\n> ${interaction.translate("music/queue:ADDED")} ${currentTrack.requestedBy}\n\n**${interaction.translate("music/queue:NEXT")}**\n${info}`) + .setDescription( + `${interaction.translate("music/nowplaying:REPEAT")}: \`${ + queue.repeatMode === QueueRepeatMode.AUTOPLAY + ? interaction.translate("music/nowplaying:AUTOPLAY") + : queue.repeatMode === QueueRepeatMode.QUEUE + ? interaction.translate("music/nowplaying:QUEUE") + : queue.repeatMode === QueueRepeatMode.TRACK + ? interaction.translate("music/nowplaying:TRACK") + : interaction.translate("common:DISABLED") + }\`\n${currentTrack.url.startsWith("./clips") ? `${currentTrack.title} (clips)` : `[${currentTrack.title}](${currentTrack.url})`}\n> ${interaction.translate("music/queue:ADDED")} ${ + currentTrack.requestedBy + }\n\n**${interaction.translate("music/queue:NEXT")}**\n${info}`, + ) .setTimestamp(); embeds.push(embed); } @@ -202,4 +201,4 @@ function generateQueueEmbeds(interaction, queue) { return embeds; } -module.exports = Queue; \ No newline at end of file +module.exports = Queue; diff --git a/commands/Music/seek.js b/commands/Music/seek.js index 973da8c4..dbb5c4b8 100644 --- a/commands/Music/seek.js +++ b/commands/Music/seek.js @@ -12,16 +12,19 @@ class Seek extends BaseCommand { .setName("seek") .setDescription(client.translate("music/seek:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("music/seek:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("music/seek:DESCRIPTION", null, "ru-RU"), + uk: client.translate("music/seek:DESCRIPTION", null, "uk-UA"), + ru: client.translate("music/seek:DESCRIPTION", null, "ru-RU"), }) - .addIntegerOption(option => option.setName("time") - .setDescription(client.translate("music/seek:TIME")) - .setDescriptionLocalizations({ - "uk": client.translate("music/seek:TIME", null, "uk-UA"), - "ru": client.translate("music/seek:TIME", null, "ru-RU"), - }) - .setRequired(true)), + .addIntegerOption(option => + option + .setName("time") + .setDescription(client.translate("music/seek:TIME")) + .setDescriptionLocalizations({ + uk: client.translate("music/seek:TIME", null, "uk-UA"), + ru: client.translate("music/seek:TIME", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -55,4 +58,4 @@ class Seek extends BaseCommand { } } -module.exports = Seek; \ No newline at end of file +module.exports = Seek; diff --git a/commands/Music/shuffle.js b/commands/Music/shuffle.js index 41648d12..d29550c2 100644 --- a/commands/Music/shuffle.js +++ b/commands/Music/shuffle.js @@ -12,8 +12,8 @@ class Shuffle extends BaseCommand { .setName("shuffle") .setDescription(client.translate("music/shuffle:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("music/shuffle:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("music/shuffle:DESCRIPTION", null, "ru-RU"), + uk: client.translate("music/shuffle:DESCRIPTION", null, "uk-UA"), + ru: client.translate("music/shuffle:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false), aliases: [], @@ -46,4 +46,4 @@ class Shuffle extends BaseCommand { } } -module.exports = Shuffle; \ No newline at end of file +module.exports = Shuffle; diff --git a/commands/Music/skip.js b/commands/Music/skip.js index 31ad93c9..be20b3b8 100644 --- a/commands/Music/skip.js +++ b/commands/Music/skip.js @@ -12,8 +12,8 @@ class Skip extends BaseCommand { .setName("skip") .setDescription(client.translate("music/skip:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("music/skip:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("music/skip:DESCRIPTION", null, "ru-RU"), + uk: client.translate("music/skip:DESCRIPTION", null, "uk-UA"), + ru: client.translate("music/skip:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false), aliases: [], @@ -46,4 +46,4 @@ class Skip extends BaseCommand { } } -module.exports = Skip; \ No newline at end of file +module.exports = Skip; diff --git a/commands/Music/skipto.js b/commands/Music/skipto.js index cac7df3e..97f4c27d 100644 --- a/commands/Music/skipto.js +++ b/commands/Music/skipto.js @@ -12,17 +12,20 @@ class Skipto extends BaseCommand { .setName("skipto") .setDescription(client.translate("music/skipto:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("music/skipto:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("music/skipto:DESCRIPTION", null, "ru-RU"), + uk: client.translate("music/skipto:DESCRIPTION", null, "uk-UA"), + ru: client.translate("music/skipto:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addIntegerOption(option => option.setName("position") - .setDescription(client.translate("music/skipto:POSITION")) - .setDescriptionLocalizations({ - "uk": client.translate("music/skipto:POSITION", null, "uk-UA"), - "ru": client.translate("music/skipto:POSITION", null, "ru-RU"), - }) - .setRequired(true)), + .addIntegerOption(option => + option + .setName("position") + .setDescription(client.translate("music/skipto:POSITION")) + .setDescriptionLocalizations({ + uk: client.translate("music/skipto:POSITION", null, "uk-UA"), + ru: client.translate("music/skipto:POSITION", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -61,4 +64,4 @@ class Skipto extends BaseCommand { } } -module.exports = Skipto; \ No newline at end of file +module.exports = Skipto; diff --git a/commands/Music/stop.js b/commands/Music/stop.js index 58997626..d26c3a87 100644 --- a/commands/Music/stop.js +++ b/commands/Music/stop.js @@ -12,8 +12,8 @@ class Stop extends BaseCommand { .setName("stop") .setDescription(client.translate("music/stop:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("music/stop:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("music/stop:DESCRIPTION", null, "ru-RU"), + uk: client.translate("music/stop:DESCRIPTION", null, "uk-UA"), + ru: client.translate("music/stop:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false), aliases: [], @@ -46,4 +46,4 @@ class Stop extends BaseCommand { } } -module.exports = Stop; \ No newline at end of file +module.exports = Stop; diff --git a/commands/Music/volume.js b/commands/Music/volume.js index 33ccbc93..729bbde3 100644 --- a/commands/Music/volume.js +++ b/commands/Music/volume.js @@ -12,18 +12,21 @@ class Volume extends BaseCommand { .setName("volume") .setDescription(client.translate("music/volume:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("music/volume:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("music/volume:DESCRIPTION", null, "ru-RU"), + uk: client.translate("music/volume:DESCRIPTION", null, "uk-UA"), + ru: client.translate("music/volume:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addIntegerOption(option => option.setName("int") - .setDescription(client.translate("common:INT")) - .setDescriptionLocalizations({ - "uk": client.translate("common:INT", null, "uk-UA"), - "ru": client.translate("common:INT", null, "ru-RU"), - }) - .setRequired(true) - .setAutocomplete(true)), + .addIntegerOption(option => + option + .setName("int") + .setDescription(client.translate("common:INT")) + .setDescriptionLocalizations({ + uk: client.translate("common:INT", null, "uk-UA"), + ru: client.translate("common:INT", null, "ru-RU"), + }) + .setRequired(true) + .setAutocomplete(true), + ), aliases: [], dirname: __dirname, ownerOnly: false, @@ -72,9 +75,9 @@ class Volume extends BaseCommand { results.slice(0, 25).map(i => ({ name: i, value: i, - }), - )); + })), + ); } } -module.exports = Volume; \ No newline at end of file +module.exports = Volume; diff --git a/commands/NSFW/nsfw.js b/commands/NSFW/nsfw.js index 8b1ccbed..e931e062 100644 --- a/commands/NSFW/nsfw.js +++ b/commands/NSFW/nsfw.js @@ -13,8 +13,8 @@ class NSFW extends BaseCommand { .setName("nsfw") .setDescription(client.translate("nsfw/nsfw:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("nsfw/nsfw:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("nsfw/nsfw:DESCRIPTION", null, "ru-RU"), + uk: client.translate("nsfw/nsfw:DESCRIPTION", null, "uk-UA"), + ru: client.translate("nsfw/nsfw:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(true), aliases: [], @@ -41,19 +41,15 @@ class NSFW extends BaseCommand { if (interaction.guildId && !interaction.channel.nsfw) return interaction.replyT("misc:NSFW_COMMAND", null, { edit: true }); const tags = ["hentai", "ecchi", "lewdanimegirls", "hentaifemdom", "animefeets", "animebooty", "biganimetiddies", "sideoppai", "ahegao"].map(tag => - JSON.parse(JSON.stringify({ - label: tag, - value: tag, - })), + JSON.parse( + JSON.stringify({ + label: tag, + value: tag, + }), + ), ); - const row = new ActionRowBuilder() - .addComponents( - new StringSelectMenuBuilder() - .setCustomId("nsfw_select") - .setPlaceholder(client.translate("common:NOTHING_SELECTED")) - .addOptions(tags), - ); + const row = new ActionRowBuilder().addComponents(new StringSelectMenuBuilder().setCustomId("nsfw_select").setPlaceholder(client.translate("common:NOTHING_SELECTED")).addOptions(tags)); const msg = await interaction.editReply({ content: interaction.translate("common:AVAILABLE_OPTIONS"), @@ -63,7 +59,7 @@ class NSFW extends BaseCommand { }); const filter = i => i.user.id === interaction.user.id; - const collector = msg.createMessageComponentCollector({ filter, idle: (2 * 60 * 1000) }); + const collector = msg.createMessageComponentCollector({ filter, idle: 2 * 60 * 1000 }); collector.on("collect", async i => { if (i.isStringSelectMenu() && i.customId === "nsfw_select") { @@ -96,4 +92,4 @@ class NSFW extends BaseCommand { } } -module.exports = NSFW; \ No newline at end of file +module.exports = NSFW; diff --git a/commands/Owner/debug.js b/commands/Owner/debug.js index d1e0a3de..5eb12933 100644 --- a/commands/Owner/debug.js +++ b/commands/Owner/debug.js @@ -12,79 +12,101 @@ class Debug extends BaseCommand { .setName("debug") .setDescription(client.translate("owner/debug:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("owner/debug:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("owner/debug:DESCRIPTION", null, "ru-RU"), + uk: client.translate("owner/debug:DESCRIPTION", null, "uk-UA"), + ru: client.translate("owner/debug:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addSubcommand(subcommand => subcommand.setName("set") - .setDescription(client.translate("owner/debug:SET")) - .setDescriptionLocalizations({ - "uk": client.translate("owner/debug:SET", null, "uk-UA"), - "ru": client.translate("owner/debug:SET", null, "ru-RU"), - }) - .addStringOption(option => option.setName("type") - .setDescription(client.translate("owner/debug:TYPE")) + .addSubcommand(subcommand => + subcommand + .setName("set") + .setDescription(client.translate("owner/debug:SET")) .setDescriptionLocalizations({ - "uk": client.translate("owner/debug:TYPE", null, "uk-UA"), - "ru": client.translate("owner/debug:TYPE", null, "ru-RU"), + uk: client.translate("owner/debug:SET", null, "uk-UA"), + ru: client.translate("owner/debug:SET", null, "ru-RU"), }) - .setRequired(true) - .setChoices( - { name: client.translate("common:LEVEL"), value: "level" }, - { name: client.translate("common:XP"), value: "xp" }, - { name: client.translate("common:CREDITS"), value: "credits" }, - { name: client.translate("economy/transactions:BANK"), value: "bank" }, - { name: client.translate("common:REP"), value: "rep" }, - )) - .addUserOption(option => option.setName("user") - .setDescription(client.translate("common:USER")) - .setDescriptionLocalizations({ - "uk": client.translate("common:USER", null, "uk-UA"), - "ru": client.translate("common:USER", null, "ru-RU"), - }) - .setRequired(true)) - .addIntegerOption(option => option.setName("int") - .setDescription(client.translate("common:INT")) - .setDescriptionLocalizations({ - "uk": client.translate("common:INT", null, "uk-UA"), - "ru": client.translate("common:INT", null, "ru-RU"), - }) - .setRequired(true)), + .addStringOption(option => + option + .setName("type") + .setDescription(client.translate("owner/debug:TYPE")) + .setDescriptionLocalizations({ + uk: client.translate("owner/debug:TYPE", null, "uk-UA"), + ru: client.translate("owner/debug:TYPE", null, "ru-RU"), + }) + .setRequired(true) + .setChoices( + { name: client.translate("common:LEVEL"), value: "level" }, + { name: client.translate("common:XP"), value: "xp" }, + { name: client.translate("common:CREDITS"), value: "credits" }, + { name: client.translate("economy/transactions:BANK"), value: "bank" }, + { name: client.translate("common:REP"), value: "rep" }, + ), + ) + .addUserOption(option => + option + .setName("user") + .setDescription(client.translate("common:USER")) + .setDescriptionLocalizations({ + uk: client.translate("common:USER", null, "uk-UA"), + ru: client.translate("common:USER", null, "ru-RU"), + }) + .setRequired(true), + ) + .addIntegerOption(option => + option + .setName("int") + .setDescription(client.translate("common:INT")) + .setDescriptionLocalizations({ + uk: client.translate("common:INT", null, "uk-UA"), + ru: client.translate("common:INT", null, "ru-RU"), + }) + .setRequired(true), + ), ) - .addSubcommand(subcommand => subcommand.setName("add") - .setDescription(client.translate("owner/debug:ADD")) - .setDescriptionLocalizations({ - "uk": client.translate("owner/debug:ADD", null, "uk-UA"), - "ru": client.translate("owner/debug:ADD", null, "ru-RU"), - }) - .addStringOption(option => option.setName("type") - .setDescription(client.translate("owner/debug:TYPE")) + .addSubcommand(subcommand => + subcommand + .setName("add") + .setDescription(client.translate("owner/debug:ADD")) .setDescriptionLocalizations({ - "uk": client.translate("owner/debug:TYPE", null, "uk-UA"), - "ru": client.translate("owner/debug:TYPE", null, "ru-RU"), + uk: client.translate("owner/debug:ADD", null, "uk-UA"), + ru: client.translate("owner/debug:ADD", null, "ru-RU"), }) - .setRequired(true) - .setChoices( - { name: client.translate("common:LEVEL"), value: "level" }, - { name: client.translate("common:XP"), value: "xp" }, - { name: client.translate("common:CREDITS"), value: "credits" }, - { name: client.translate("economy/transactions:BANK"), value: "bank" }, - { name: client.translate("common:REP"), value: "rep" }, - )) - .addUserOption(option => option.setName("user") - .setDescription(client.translate("common:USER")) - .setDescriptionLocalizations({ - "uk": client.translate("common:USER", null, "uk-UA"), - "ru": client.translate("common:USER", null, "ru-RU"), - }) - .setRequired(true)) - .addIntegerOption(option => option.setName("int") - .setDescription(client.translate("common:INT")) - .setDescriptionLocalizations({ - "uk": client.translate("common:INT", null, "uk-UA"), - "ru": client.translate("common:INT", null, "ru-RU"), - }) - .setRequired(true)), + .addStringOption(option => + option + .setName("type") + .setDescription(client.translate("owner/debug:TYPE")) + .setDescriptionLocalizations({ + uk: client.translate("owner/debug:TYPE", null, "uk-UA"), + ru: client.translate("owner/debug:TYPE", null, "ru-RU"), + }) + .setRequired(true) + .setChoices( + { name: client.translate("common:LEVEL"), value: "level" }, + { name: client.translate("common:XP"), value: "xp" }, + { name: client.translate("common:CREDITS"), value: "credits" }, + { name: client.translate("economy/transactions:BANK"), value: "bank" }, + { name: client.translate("common:REP"), value: "rep" }, + ), + ) + .addUserOption(option => + option + .setName("user") + .setDescription(client.translate("common:USER")) + .setDescriptionLocalizations({ + uk: client.translate("common:USER", null, "uk-UA"), + ru: client.translate("common:USER", null, "ru-RU"), + }) + .setRequired(true), + ) + .addIntegerOption(option => + option + .setName("int") + .setDescription(client.translate("common:INT")) + .setDescriptionLocalizations({ + uk: client.translate("common:INT", null, "uk-UA"), + ru: client.translate("common:INT", null, "ru-RU"), + }) + .setRequired(true), + ), ), aliases: [], dirname: __dirname, @@ -122,7 +144,6 @@ class Debug extends BaseCommand { guildId: interaction.guildId, }); - switch (type) { case "level": { memberData.level = int; @@ -254,4 +275,4 @@ class Debug extends BaseCommand { } } -module.exports = Debug; \ No newline at end of file +module.exports = Debug; diff --git a/commands/Owner/eval.js b/commands/Owner/eval.js index 1a6e7086..4dd2a1a8 100644 --- a/commands/Owner/eval.js +++ b/commands/Owner/eval.js @@ -12,17 +12,20 @@ class Eval extends BaseCommand { .setName("eval") .setDescription(client.translate("owner/eval:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("owner/eval:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("owner/eval:DESCRIPTION", null, "ru-RU"), + uk: client.translate("owner/eval:DESCRIPTION", null, "uk-UA"), + ru: client.translate("owner/eval:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(true) - .addStringOption(option => option.setName("code") - .setDescription(client.translate("owner/eval:CODE")) - .setDescriptionLocalizations({ - "uk": client.translate("owner/eval:CODE", null, "uk-UA"), - "ru": client.translate("owner/eval:CODE", null, "ru-RU"), - }) - .setRequired(true)), + .addStringOption(option => + option + .setName("code") + .setDescription(client.translate("owner/eval:CODE")) + .setDescriptionLocalizations({ + uk: client.translate("owner/eval:CODE", null, "uk-UA"), + ru: client.translate("owner/eval:CODE", null, "ru-RU"), + }) + .setRequired(true), + ), aliases: [], dirname: __dirname, ownerOnly: true, @@ -48,22 +51,24 @@ class Eval extends BaseCommand { const code = interaction.options.getString("code"); const result = new Promise(resolve => resolve(eval(code))); - return result.then(output => { - if (typeof output !== "string") output = require("util").inspect(output); - if (output.includes(client.token)) output = output.replace(client.token, "T0K3N"); + return result + .then(output => { + if (typeof output !== "string") output = require("util").inspect(output); + if (output.includes(client.token)) output = output.replace(client.token, "T0K3N"); - interaction.editReply({ - content: "```js\n" + output + "```", - }); - }).catch(err => { - console.log(err); - err = err.toString(); - if (err.includes(client.token)) err = err.replace(client.token, "T0K3N"); + interaction.editReply({ + content: "```js\n" + output + "```", + }); + }) + .catch(err => { + console.log(err); + err = err.toString(); + if (err.includes(client.token)) err = err.replace(client.token, "T0K3N"); - interaction.editReply({ - content: "```js\n" + err + "```", + interaction.editReply({ + content: "```js\n" + err + "```", + }); }); - }); } } -module.exports = Eval; \ No newline at end of file +module.exports = Eval; diff --git a/commands/Owner/reload.js b/commands/Owner/reload.js index a60310a1..26a6e340 100644 --- a/commands/Owner/reload.js +++ b/commands/Owner/reload.js @@ -1,7 +1,7 @@ const { SlashCommandBuilder } = require("discord.js"); const BaseCommand = require("../../base/BaseCommand"), i18next = require("i18next"); - // autoUpdateDocs = require("../../helpers/autoUpdateDocs"); +// autoUpdateDocs = require("../../helpers/autoUpdateDocs"); class Reload extends BaseCommand { /** @@ -14,18 +14,21 @@ class Reload extends BaseCommand { .setName("reload") .setDescription(client.translate("owner/reload:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("owner/reload:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("owner/reload:DESCRIPTION", null, "ru-RU"), + uk: client.translate("owner/reload:DESCRIPTION", null, "uk-UA"), + ru: client.translate("owner/reload:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(true) - .addStringOption(option => option.setName("command") - .setDescription(client.translate("common:COMMAND")) - .setDescriptionLocalizations({ - "uk": client.translate("common:COMMAND", null, "uk-UA"), - "ru": client.translate("common:COMMAND", null, "ru-RU"), - }) - .setRequired(true) - .setAutocomplete(true)), + .addStringOption(option => + option + .setName("command") + .setDescription(client.translate("common:COMMAND")) + .setDescriptionLocalizations({ + uk: client.translate("common:COMMAND", null, "uk-UA"), + ru: client.translate("common:COMMAND", null, "ru-RU"), + }) + .setRequired(true) + .setAutocomplete(true), + ), aliases: [], dirname: __dirname, ownerOnly: true, @@ -71,12 +74,15 @@ class Reload extends BaseCommand { results = client.commands.filter(c => c.command.name.includes(command)); return interaction.respond( - results.map(c => c).slice(0, 25).map(c => ({ - name: c.command.name, - value: c.command.name, - }), - )); + results + .map(c => c) + .slice(0, 25) + .map(c => ({ + name: c.command.name, + value: c.command.name, + })), + ); } } -module.exports = Reload; \ No newline at end of file +module.exports = Reload; diff --git a/commands/Owner/say.js b/commands/Owner/say.js index efa80a90..4b1bc667 100644 --- a/commands/Owner/say.js +++ b/commands/Owner/say.js @@ -12,23 +12,38 @@ class Say extends BaseCommand { .setName("say") .setDescription(client.translate("owner/say:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("owner/say:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("owner/say:DESCRIPTION", null, "ru-RU"), + uk: client.translate("owner/say:DESCRIPTION", null, "uk-UA"), + ru: client.translate("owner/say:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(false) - .addStringOption(option => option.setName("message") - .setDescription(client.translate("common:MESSAGE")) - .setDescriptionLocalizations({ - "uk": client.translate("common:MESSAGE", null, "uk-UA"), - "ru": client.translate("common:MESSAGE", null, "ru-RU"), - }) - .setRequired(true)) - .addChannelOption(option => option.setName("channel") - .setDescription(client.translate("common:CHANNEL")) - .setDescriptionLocalizations({ - "uk": client.translate("common:CHANNEL", null, "uk-UA"), - "ru": client.translate("common:CHANNEL", null, "ru-RU"), - })), + .addStringOption(option => + option + .setName("message") + .setDescription(client.translate("common:MESSAGE")) + .setDescriptionLocalizations({ + uk: client.translate("common:MESSAGE", null, "uk-UA"), + ru: client.translate("common:MESSAGE", null, "ru-RU"), + }) + .setRequired(true), + ) + .addChannelOption(option => + option + .setName("channel") + .setDescription(client.translate("common:CHANNEL")) + .setDescriptionLocalizations({ + uk: client.translate("common:CHANNEL", null, "uk-UA"), + ru: client.translate("common:CHANNEL", null, "ru-RU"), + }), + ) + .addAttachmentOption(option => + option + .setName("attachment") + .setDescription(client.translate("common:ATTACHMENT")) + .setDescriptionLocalizations({ + uk: client.translate("common:ATTACHMENT", null, "uk-UA"), + ru: client.translate("common:ATTACHMENT", null, "ru-RU"), + }), + ), aliases: [], dirname: __dirname, ownerOnly: true, @@ -51,6 +66,7 @@ class Say extends BaseCommand { await interaction.deferReply({ ephemeral: true }); const message = interaction.options.getString("message"), + attachment = interaction.options.getAttachment("attachment"), channel = interaction.options.getChannel("channel"); if (!channel) { @@ -59,6 +75,10 @@ class Say extends BaseCommand { setTimeout(function () { interaction.channel.send({ content: message, + files: attachment ? [{ + name: attachment.name, + attachment: attachment.url, + }] : null, }); interaction.replyT("owner/say:DONE", { @@ -72,6 +92,10 @@ class Say extends BaseCommand { setTimeout(function () { channel.send({ content: message, + files: attachment ? [{ + name: attachment.name, + attachment: attachment.url, + }] : null, }); interaction.replyT("owner/say:DONE", { @@ -83,4 +107,4 @@ class Say extends BaseCommand { } } -module.exports = Say; \ No newline at end of file +module.exports = Say; diff --git a/commands/Owner/servers.js b/commands/Owner/servers.js index 2850bd07..8bff3ff3 100644 --- a/commands/Owner/servers.js +++ b/commands/Owner/servers.js @@ -12,8 +12,8 @@ class Servers extends BaseCommand { .setName("servers") .setDescription(client.translate("owner/servers:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("owner/servers:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("owner/servers:DESCRIPTION", null, "ru-RU"), + uk: client.translate("owner/servers:DESCRIPTION", null, "uk-UA"), + ru: client.translate("owner/servers:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(true), aliases: [], @@ -40,21 +40,11 @@ class Servers extends BaseCommand { let currentPage = 0; const embeds = generateServersEmbeds(interaction, client.guilds.cache); - const row = new ActionRowBuilder() - .addComponents( - new ButtonBuilder() - .setCustomId("servers_prev_page") - .setStyle(ButtonStyle.Primary) - .setEmoji("⬅️"), - new ButtonBuilder() - .setCustomId("servers_next_page") - .setStyle(ButtonStyle.Primary) - .setEmoji("➡️"), - new ButtonBuilder() - .setCustomId("servers_stop") - .setStyle(ButtonStyle.Danger) - .setEmoji("⏹️"), - ); + const row = new ActionRowBuilder().addComponents( + new ButtonBuilder().setCustomId("servers_prev_page").setStyle(ButtonStyle.Primary).setEmoji("⬅️"), + new ButtonBuilder().setCustomId("servers_next_page").setStyle(ButtonStyle.Primary).setEmoji("➡️"), + new ButtonBuilder().setCustomId("servers_stop").setStyle(ButtonStyle.Danger).setEmoji("⏹️"), + ); await interaction.editReply({ content: `${interaction.translate("common:PAGE")}: **${currentPage + 1}**/**${embeds.length}**`, @@ -63,7 +53,7 @@ class Servers extends BaseCommand { }); const filter = i => i.user.id === interaction.user.id; - const collector = interaction.guild === null ? (await interaction.user.createDM()).createMessageComponentCollector({ filter, idle: (20 * 1000) }) : interaction.channel.createMessageComponentCollector({ filter, idle: (20 * 1000) }); + const collector = interaction.guild === null ? (await interaction.user.createDM()).createMessageComponentCollector({ filter, idle: 20 * 1000 }) : interaction.channel.createMessageComponentCollector({ filter, idle: 20 * 1000 }); collector.on("collect", async i => { if (i.isButton()) { @@ -119,11 +109,24 @@ function generateServersEmbeds(interaction, servers) { let k = 10; for (let i = 0; i < servers.size; i += 10) { - const current = servers.sort((a, b) => b.memberCount - a.memberCount).map(g => g).slice(i, k); + const current = servers + .sort((a, b) => b.memberCount - a.memberCount) + .map(g => g) + .slice(i, k); let j = i; k += 10; - const info = current.map(server => `${++j}. ${server.name} | ${server.memberCount} ${interaction.client.functions.getNoun(server.memberCount, interaction.translate("misc:NOUNS:MEMBERS:1"), interaction.translate("misc:NOUNS:MEMBERS:2"), interaction.translate("misc:NOUNS:MEMBERS:5"))}`).join("\n"); + const info = current + .map( + server => + `${++j}. ${server.name} | ${server.memberCount} ${interaction.client.functions.getNoun( + server.memberCount, + interaction.translate("misc:NOUNS:MEMBERS:1"), + interaction.translate("misc:NOUNS:MEMBERS:2"), + interaction.translate("misc:NOUNS:MEMBERS:5"), + )}`, + ) + .join("\n"); const embed = new EmbedBuilder() .setColor(interaction.client.config.embed.color) @@ -139,4 +142,4 @@ function generateServersEmbeds(interaction, servers) { return embeds; } -module.exports = Servers; \ No newline at end of file +module.exports = Servers; diff --git a/commands/SunCountry/sendmessage.js b/commands/SunCountry/sendmessage.js index 321735b9..936015e4 100644 --- a/commands/SunCountry/sendmessage.js +++ b/commands/SunCountry/sendmessage.js @@ -12,56 +12,75 @@ class Sendmessage extends BaseCommand { .setName("sendmessage") .setDescription(client.translate("suncountry/sendmessage:DESCRIPTION")) .setDescriptionLocalizations({ - "uk": client.translate("suncountry/sendmessage:DESCRIPTION", null, "uk-UA"), - "ru": client.translate("suncountry/sendmessage:DESCRIPTION", null, "ru-RU"), + uk: client.translate("suncountry/sendmessage:DESCRIPTION", null, "uk-UA"), + ru: client.translate("suncountry/sendmessage:DESCRIPTION", null, "ru-RU"), }) .setDMPermission(true) - .addSubcommand(subcommand => subcommand.setName("rpinfo") - .setDescription(client.translate("suncountry/sendmessage:RPINFO")) - .setDescriptionLocalizations({ - "uk": client.translate("suncountry/sendmessage:RPINFO", null, "uk-UA"), - "ru": client.translate("suncountry/sendmessage:RPINFO", null, "ru-RU"), - }) - .addStringOption(option => option.setName("text") - .setDescription(client.translate("common:MESSAGE")) + .addSubcommand(subcommand => + subcommand + .setName("rpinfo") + .setDescription(client.translate("suncountry/sendmessage:RPINFO")) .setDescriptionLocalizations({ - "uk": client.translate("common:MESSAGE", null, "uk-UA"), - "ru": client.translate("common:MESSAGE", null, "ru-RU"), + uk: client.translate("suncountry/sendmessage:RPINFO", null, "uk-UA"), + ru: client.translate("suncountry/sendmessage:RPINFO", null, "ru-RU"), }) - .setRequired(true)) - .addAttachmentOption(option => option.setName("attachment") - .setDescription(client.translate("common:ATTACHMENT")) - .setDescriptionLocalizations({ - "uk": client.translate("common:ATTACHMENT", null, "uk-UA"), - "ru": client.translate("common:ATTACHMENT", null, "ru-RU"), - })), + .addStringOption(option => + option + .setName("text") + .setDescription(client.translate("common:MESSAGE")) + .setDescriptionLocalizations({ + uk: client.translate("common:MESSAGE", null, "uk-UA"), + ru: client.translate("common:MESSAGE", null, "ru-RU"), + }) + .setRequired(true), + ) + .addAttachmentOption(option => + option + .setName("attachment") + .setDescription(client.translate("common:ATTACHMENT")) + .setDescriptionLocalizations({ + uk: client.translate("common:ATTACHMENT", null, "uk-UA"), + ru: client.translate("common:ATTACHMENT", null, "ru-RU"), + }), + ), ) - .addSubcommand(subcommand => subcommand.setName("instalife") - .setDescription(client.translate("suncountry/sendmessage:INSTALIFE")) - .setDescriptionLocalizations({ - "uk": client.translate("suncountry/sendmessage:INSTALIFE", null, "uk-UA"), - "ru": client.translate("suncountry/sendmessage:INSTALIFE", null, "ru-RU"), - }) - .addStringOption(option => option.setName("name") - .setDescription(client.translate("common:USERNAME")) + .addSubcommand(subcommand => + subcommand + .setName("instalife") + .setDescription(client.translate("suncountry/sendmessage:INSTALIFE")) .setDescriptionLocalizations({ - "uk": client.translate("common:USERNAME", null, "uk-UA"), - "ru": client.translate("common:USERNAME", null, "ru-RU"), + uk: client.translate("suncountry/sendmessage:INSTALIFE", null, "uk-UA"), + ru: client.translate("suncountry/sendmessage:INSTALIFE", null, "ru-RU"), }) - .setRequired(true)) - .addStringOption(option => option.setName("text") - .setDescription(client.translate("common:MESSAGE")) - .setDescriptionLocalizations({ - "uk": client.translate("common:MESSAGE", null, "uk-UA"), - "ru": client.translate("common:MESSAGE", null, "ru-RU"), - }) - .setRequired(true)) - .addAttachmentOption(option => option.setName("attachment") - .setDescription(client.translate("common:ATTACHMENT")) - .setDescriptionLocalizations({ - "uk": client.translate("common:ATTACHMENT", null, "uk-UA"), - "ru": client.translate("common:ATTACHMENT", null, "ru-RU"), - })), + .addStringOption(option => + option + .setName("name") + .setDescription(client.translate("common:USERNAME")) + .setDescriptionLocalizations({ + uk: client.translate("common:USERNAME", null, "uk-UA"), + ru: client.translate("common:USERNAME", null, "ru-RU"), + }) + .setRequired(true), + ) + .addStringOption(option => + option + .setName("text") + .setDescription(client.translate("common:MESSAGE")) + .setDescriptionLocalizations({ + uk: client.translate("common:MESSAGE", null, "uk-UA"), + ru: client.translate("common:MESSAGE", null, "ru-RU"), + }) + .setRequired(true), + ) + .addAttachmentOption(option => + option + .setName("attachment") + .setDescription(client.translate("common:ATTACHMENT")) + .setDescriptionLocalizations({ + uk: client.translate("common:ATTACHMENT", null, "uk-UA"), + ru: client.translate("common:ATTACHMENT", null, "ru-RU"), + }), + ), ), aliases: [], dirname: __dirname, @@ -101,14 +120,18 @@ class Sendmessage extends BaseCommand { .setImage(attachment ? attachment.url : null) .setDescription(text); - channel.send({ - content: command === "rpinfo" ? text : null, - files: command === "rpinfo" ? (attachment ? [{ + const content = command === "rpinfo" ? text : null, + files = command === "rpinfo" ? (attachment ? [{ name: attachment.name, attachment: attachment.url, }] : null) : null, - embeds: command === "instalife" ? [embed] : null, - }).then(message => { + embeds = command === "instalife" ? [embed] : null; + + channel.send({ + content, + files, + embeds, + }) .then(message => { interaction.success("suncountry/sendmessage:MESSAGE_SENT", { message: message.url, }, { edit: true }); @@ -116,4 +139,4 @@ class Sendmessage extends BaseCommand { } } -module.exports = Sendmessage; \ No newline at end of file +module.exports = Sendmessage; diff --git a/config.sample.js b/config.sample.js index 76d20fdc..23858699 100644 --- a/config.sample.js +++ b/config.sample.js @@ -2,7 +2,7 @@ module.exports = { /* The token of your Discord Bot */ token: "XXXXXXXXXXX", /* ID of Bot's user */ - user: "XXXXXXXXXXX", + userId: "XXXXXXXXXXX", /* Set to true for production */ production: true, /* For the support server */ diff --git a/dashboard/dashboard-core b/dashboard/dashboard-core index b9ef79e4..f18f32bc 160000 --- a/dashboard/dashboard-core +++ b/dashboard/dashboard-core @@ -1 +1 @@ -Subproject commit b9ef79e4bfd01e89ed8b5eb0a083ff2d759bce23 +Subproject commit f18f32bc4d4dbb066c8ec24d6f6a648b51a92ddf diff --git a/dashboard/dashboard.js b/dashboard/dashboard.js index 57049da5..d6599070 100644 --- a/dashboard/dashboard.js +++ b/dashboard/dashboard.js @@ -41,7 +41,7 @@ module.exports.load = async client => { const Dashboard = new DBD.Dashboard({ port: client.config.dashboard.port, client: { - id: client.config.user, + id: client.config.userId, secret: client.config.dashboard.secret, }, SSL: { @@ -57,7 +57,7 @@ module.exports.load = async client => { requiredPermissions: PermissionsBitField.Flags.ViewChannel, minimizedConsoleLogs: true, invite: { - clientId: client.config.user, + clientId: client.config.userId, scopes: ["bot", "applications.commands"], permissions: "8", redirectUri: `${client.config.dashboard.domain}${client.config.dashboard.port !== 80 ? `:${client.config.dashboard.port}` : ""}`, diff --git a/events/CommandHandler.js b/events/CommandHandler.js index 2af5e2b9..5b4b4190 100644 --- a/events/CommandHandler.js +++ b/events/CommandHandler.js @@ -40,10 +40,12 @@ class CommandHandler extends BaseEvent { if (!userData.achievements.firstCommand.achieved) { const args = { content: interaction.user.toString(), - files: [{ - name: "achievement_unlocked2.png", - attachment: "./assets/img/achievements/achievement_unlocked2.png", - }], + files: [ + { + name: "achievement_unlocked2.png", + attachment: "./assets/img/achievements/achievement_unlocked2.png", + }, + ], }; userData.achievements.firstCommand.progress.now = 1; @@ -54,10 +56,10 @@ class CommandHandler extends BaseEvent { interaction.user.send(args); } - client.logger.log(`User ${interaction.user.getUsername()} used ${command.command.name} in ${interaction.guild ? interaction.guild.name : "DM"} with arguments: ${interaction.options.data.length > 0 ? interaction.options.data.map(arg => { return `${arg.name}: ${arg.value}`; }).join(", ") : "no args"}`, "cmd"); + client.logger.log(`User ${interaction.user.getUsername()} used ${command.command.name} in ${interaction.guild ? interaction.guild.name : "DM"} with arguments: ${interaction.options.data.length > 0 ? interaction.options.data.map(arg => { return `${arg.name}: ${arg.value}`; }).join(", ") : "no args" }`, "cmd"); return command.execute(client, interaction, data); } } -module.exports = CommandHandler; \ No newline at end of file +module.exports = CommandHandler; diff --git a/events/Guild/guildBanAdd.js b/events/Guild/guildBanAdd.js index 77139c9d..47f3c61f 100644 --- a/events/Guild/guildBanAdd.js +++ b/events/Guild/guildBanAdd.js @@ -30,4 +30,4 @@ class guildBanAdd extends BaseEvent { } } -module.exports = guildBanAdd; \ No newline at end of file +module.exports = guildBanAdd; diff --git a/events/Guild/guildCreate.js b/events/Guild/guildCreate.js index 8cd819e4..41ac0e09 100644 --- a/events/Guild/guildCreate.js +++ b/events/Guild/guildCreate.js @@ -15,9 +15,7 @@ class GuildCreate extends BaseEvent { * @param {import("discord.js").Guild} guild */ async execute(client, guild) { - const userData = await client.findOrCreateUser({ - id: guild.ownerId, - }); + const userData = await client.findOrCreateUser({ id: guild.ownerId }); if (!userData.achievements.invite.achieved) { userData.achievements.invite.progress.now = 1; @@ -39,10 +37,12 @@ class GuildCreate extends BaseEvent { const owner = await guild.fetchOwner(); owner.send({ - files: [{ - name: "unlocked.png", - attachment: "./assets/img/achievements/achievement_unlocked7.png", - }], + files: [ + { + name: "unlocked.png", + attachment: "./assets/img/achievements/achievement_unlocked7.png", + }, + ], embeds: [thanks], }); @@ -63,4 +63,4 @@ class GuildCreate extends BaseEvent { } } -module.exports = GuildCreate; \ No newline at end of file +module.exports = GuildCreate; diff --git a/events/Guild/guildDelete.js b/events/Guild/guildDelete.js index bc1165cc..b557fe7f 100644 --- a/events/Guild/guildDelete.js +++ b/events/Guild/guildDelete.js @@ -29,4 +29,4 @@ class GuildDelete extends BaseEvent { } } -module.exports = GuildDelete; \ No newline at end of file +module.exports = GuildDelete; diff --git a/events/Guild/guildMemberAdd.js b/events/Guild/guildMemberAdd.js index e2945b55..f1eaca59 100644 --- a/events/Guild/guildMemberAdd.js +++ b/events/Guild/guildMemberAdd.js @@ -79,13 +79,23 @@ class GuildMemberAdd extends BaseEvent { ctx.fillText(member.user.username, canvas.width - 670, canvas.height - 250); // Draw server name - ctx.font = applyText(canvas, client.translate("administration/welcome:IMG_WELCOME", { - server: member.guild.name, - }, guildData.language), 53, 625, "RubikMonoOne"); + ctx.font = applyText( + canvas, + client.translate("administration/welcome:IMG_WELCOME", { + server: member.guild.name, + }, guildData.language), + 53, + 625, + "RubikMonoOne", + ); - ctx.fillText(client.translate("administration/welcome:IMG_WELCOME", { - server: member.guild.name, - }, guildData.language), canvas.width - 700, canvas.height - 70); + ctx.fillText( + client.translate("administration/welcome:IMG_WELCOME", { + server: member.guild.name, + }, guildData.language), + canvas.width - 700, + canvas.height - 70, + ); // Draw discriminator ctx.font = "35px RubikMonoOne"; @@ -117,9 +127,11 @@ class GuildMemberAdd extends BaseEvent { ctx.closePath(); ctx.clip(); - const avatar = await Canvas.loadImage(member.displayAvatarURL({ - extension: "jpg", - })); + const avatar = await Canvas.loadImage( + member.displayAvatarURL({ + extension: "jpg", + }), + ); ctx.drawImage(avatar, 45, 90, 270, 270); const attachment = new AttachmentBuilder(canvas.toBuffer(), { name: "welcome-image.png" }); @@ -128,11 +140,10 @@ class GuildMemberAdd extends BaseEvent { content: message, files: [attachment], }); - } else - channel.send({ content: message }); + } else channel.send({ content: message }); } } } } -module.exports = GuildMemberAdd; \ No newline at end of file +module.exports = GuildMemberAdd; diff --git a/events/Guild/guildMemberRemove.js b/events/Guild/guildMemberRemove.js index 67d5b570..d170cb55 100644 --- a/events/Guild/guildMemberRemove.js +++ b/events/Guild/guildMemberRemove.js @@ -77,13 +77,23 @@ class GuildMemberRemove extends BaseEvent { ctx.fillText(member.user.username, canvas.width - 670, canvas.height - 250); // Draw server name - ctx.font = applyText(canvas, client.translate("administration/goodbye:IMG_GOODBYE", { - server: member.guild.name, - }, guildData.language), 53, 625, "RubikMonoOne"); + ctx.font = applyText( + canvas, + client.translate("administration/goodbye:IMG_GOODBYE", { + server: member.guild.name, + }, guildData.language), + 53, + 625, + "RubikMonoOne", + ); - ctx.fillText(client.translate("administration/goodbye:IMG_GOODBYE", { - server: member.guild.name, - }, guildData.language), canvas.width - 700, canvas.height - 70); + ctx.fillText( + client.translate("administration/goodbye:IMG_GOODBYE", { + server: member.guild.name, + }, guildData.language), + canvas.width - 700, + canvas.height - 70, + ); // Draw discriminator ctx.font = "35px RubikMonoOne"; @@ -91,7 +101,11 @@ class GuildMemberRemove extends BaseEvent { // Draw membercount ctx.font = "22px RubikMonoOne"; - ctx.fillText(`${member.guild.memberCount} ${client.functions.getNoun(member.guild.memberCount, client.translate("misc:NOUNS:MEMBERS:1", null, guildData.language), client.translate("misc:NOUNS:MEMBERS:2", null, guildData.language), client.translate("misc:NOUNS:MEMBERS:5", null, guildData.language))}`, 40, canvas.height - 35); + ctx.fillText( + `${member.guild.memberCount} ${client.functions.getNoun(member.guild.memberCount, client.translate("misc:NOUNS:MEMBERS:1", null, guildData.language), client.translate("misc:NOUNS:MEMBERS:2", null, guildData.language), client.translate("misc:NOUNS:MEMBERS:5", null, guildData.language))}`, + 40, + canvas.height - 35, + ); // Draw # for discriminator ctx.fillStyle = "#FFFFFF"; @@ -115,10 +129,12 @@ class GuildMemberRemove extends BaseEvent { ctx.closePath(); ctx.clip(); - const avatar = await Canvas.loadImage(member.displayAvatarURL({ - extension: "png", - size: 512, - })); + const avatar = await Canvas.loadImage( + member.displayAvatarURL({ + extension: "png", + size: 512, + }), + ); ctx.drawImage(avatar, 45, 90, 270, 270); const attachment = new AttachmentBuilder(canvas.toBuffer(), { name: "goodbye-image.png" }); @@ -127,11 +143,10 @@ class GuildMemberRemove extends BaseEvent { content: message, files: [attachment], }); - } else - channel.send({ content: message }); + } else channel.send({ content: message }); } } } } -module.exports = GuildMemberRemove; \ No newline at end of file +module.exports = GuildMemberRemove; diff --git a/events/Guild/guildMemberUpdate.js b/events/Guild/guildMemberUpdate.js index 7c6b30be..a3c3aa90 100644 --- a/events/Guild/guildMemberUpdate.js +++ b/events/Guild/guildMemberUpdate.js @@ -20,9 +20,7 @@ class GuildMemberUpdate extends BaseEvent { if (oldMember.roles.cache.some(r => r.id === "940149470975365191")) return; if (newMember?.roles.cache.some(r => r.id === "940149470975365191")) { - const userData = await client.findOrCreateUser({ - id: newMember.id, - }); + const userData = await client.findOrCreateUser({ id: newMember.id }); userData.achievements.tip.progress.now = 1; userData.achievements.tip.achieved = true; @@ -30,13 +28,15 @@ class GuildMemberUpdate extends BaseEvent { await userData.save(); newMember.send({ - files: [{ - name: "achievement_unlocked5.png", - attachment: "./assets/img/achievements/achievement_unlocked5.png", - }], + files: [ + { + name: "achievement_unlocked5.png", + attachment: "./assets/img/achievements/achievement_unlocked5.png", + }, + ], }); } } } -module.exports = GuildMemberUpdate; \ No newline at end of file +module.exports = GuildMemberUpdate; diff --git a/events/MessageHandler.js b/events/MessageHandler.js index fc7378a9..6c373369 100644 --- a/events/MessageHandler.js +++ b/events/MessageHandler.js @@ -58,9 +58,14 @@ class MessageCreate extends BaseEvent { .addFields([ { name: message.translate("misc:QUOTE_ATTACHED"), - value: msg.attachments.size > 0 ? msg.attachments.map(a => { - return `[${a.name}](${a.url})`; - }).join("\n") : `*${message.translate("common:MISSING")}*`, + value: + msg.attachments.size > 0 + ? msg.attachments + .map(a => { + return `[${a.name}](${a.url})`; + }) + .join("\n") + : `*${message.translate("common:MISSING")}*`, }, ]) .setFooter({ @@ -69,17 +74,10 @@ class MessageCreate extends BaseEvent { .setColor(client.config.embed.color) .setTimestamp(msg.createdTimestamp); - const row = new ActionRowBuilder() - .addComponents( - new ButtonBuilder() - .setLabel(message.translate("misc:QUOTE_JUMP")) - .setStyle(ButtonStyle.Link) - .setURL(msg.url), - new ButtonBuilder() - .setCustomId("quote_delete") - .setEmoji("1102200816582000750") - .setStyle(ButtonStyle.Danger), - ); + const row = new ActionRowBuilder().addComponents( + new ButtonBuilder().setLabel(message.translate("misc:QUOTE_JUMP")).setStyle(ButtonStyle.Link).setURL(msg.url), + new ButtonBuilder().setCustomId("quote_delete").setEmoji("1102200816582000750").setStyle(ButtonStyle.Danger), + ); const reply = await message.reply({ embeds: [embed], @@ -87,18 +85,17 @@ class MessageCreate extends BaseEvent { }); const filter = i => i.user.id === message.author.id; - const collector = message.channel.createMessageComponentCollector({ filter, time: (60 * 1000) }); + const collector = message.channel.createMessageComponentCollector({ filter, time: 60 * 1000 }); collector.on("collect", async i => { - if (i.isButton() && i.customId === "quote_delete") - if (reply.deletable) await reply.delete(); + if (i.isButton() && i.customId === "quote_delete") if (reply.deletable) reply.delete(); }); } if (data.guildData.plugins.automod.enabled && !data.guildData.plugins.automod.ignored.includes(message.channel.id)) if (/(discord\.(gg|io|me|li)\/.+|discordapp\.com\/invite\/.+)/i.test(message.content)) if (!message.channel.permissionsFor(message.member).has(PermissionsBitField.Flags.ManageMessages)) { - await message.error("administration/automod:DELETED"); + await message.error("administration/automod:DELETED", null, { mention: true }); message.delete(); } @@ -114,9 +111,7 @@ class MessageCreate extends BaseEvent { } message.mentions.users.forEach(async u => { - const userData = await client.findOrCreateUser({ - id: u.id, - }); + const userData = await client.findOrCreateUser({ id: u.id }); if (userData.afk) message.replyT("general/afk:IS_AFK", { user: u.getUsername(), reason: userData.afk }, { ephemeral: true }); }); @@ -138,10 +133,9 @@ async function updateXp(client, msg, memberData) { level = parseInt(memberData.level), isInCooldown = xpCooldown[msg.author.id]; - if (isInCooldown) - if (isInCooldown > Date.now()) return; + if (isInCooldown) if (isInCooldown > Date.now()) return; - const toWait = Date.now() + (60 * 1000); // 1 min + const toWait = Date.now() + 60 * 1000; // 1 min xpCooldown[msg.author.id] = toWait; const won = client.functions.randomNum(1, 2); @@ -162,4 +156,4 @@ async function updateXp(client, msg, memberData) { await memberData.save(); } -module.exports = MessageCreate; \ No newline at end of file +module.exports = MessageCreate; diff --git a/events/Monitoring/messageUpdate.js b/events/Monitoring/messageUpdate.js index 4d865e69..b56b7198 100644 --- a/events/Monitoring/messageUpdate.js +++ b/events/Monitoring/messageUpdate.js @@ -38,8 +38,7 @@ class messageUpdate extends BaseEvent { embeds: [embed], }); } - } } -module.exports = messageUpdate; \ No newline at end of file +module.exports = messageUpdate; diff --git a/events/ready.js b/events/ready.js index c39be126..386eb10e 100644 --- a/events/ready.js +++ b/events/ready.js @@ -33,7 +33,7 @@ class Ready extends BaseEvent { client.logger.log(`Loaded a total of ${commands.length} command(s).`, "ready"); client.logger.log(`${client.user.getUsername()}, ready to serve ${tUsers} members in ${tServers} servers.`, "ready"); - client.logger.log(`Invite Link: ${client.generateInvite({ scopes: ["bot", "applications.commands"], permissions: [ PermissionsBitField.Flags.Administrator ] })}`, "ready"); + client.logger.log(`Invite Link: ${client.generateInvite({ scopes: ["bot", "applications.commands"], permissions: [PermissionsBitField.Flags.Administrator] })}`, "ready"); console.timeEnd("botReady"); @@ -65,4 +65,4 @@ class Ready extends BaseEvent { } } -module.exports = Ready; \ No newline at end of file +module.exports = Ready; diff --git a/helpers/autoUpdateDocs.js b/helpers/autoUpdateDocs.js index 5e659bdd..b9c77c5a 100644 --- a/helpers/autoUpdateDocs.js +++ b/helpers/autoUpdateDocs.js @@ -24,9 +24,7 @@ module.exports.update = function (client) { // }) categories.sort().forEach(cat => { - const categoriesArray = [ - ["Название", "Описание", "Использование", "Разрешено использование"], - ]; + const categoriesArray = [["Название", "Описание", "Использование", "Разрешено использование"]]; const cmds = [...new Map(commands.filter(cmd => cmd.category === cat).map(v => [v.constructor.name, v])).values()]; text += `### ${cat} (${cmds.length} ${client.functions.getNoun(cmds.length, "команда", "команды", "команд")})\n\n`; @@ -47,4 +45,4 @@ module.exports.update = function (client) { if (!fs.existsSync("./dashboard/public/docs")) fs.mkdirSync("./dashboard/public/docs"); 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 d417d488..37fb5fb1 100644 --- a/helpers/birthdays.js +++ b/helpers/birthdays.js @@ -13,57 +13,55 @@ module.exports.init = async function (client) { currentYear = date.getFullYear(); client.guilds.cache.forEach(async guild => { - const guildData = await client.findOrCreateGuild({ - id: guild.id, - }); + const guildData = await client.findOrCreateGuild({ id: guild.id }); if (guildData.plugins.birthdays) { const channel = client.channels.cache.get(guildData.plugins.birthdays); if (channel) { - client.usersData.find({ birthdate: { $gt: 1 } }) - .then(async users => { - for (const user of users) { - if (guild.members.cache.find(m => m.id === user.id)) { - const userDate = new Date(user.birthdate); - const day = userDate.getDate(); - const month = userDate.getMonth(); - const year = userDate.getFullYear(); - const age = currentYear - year; + client.usersData.find({ birthdate: { $gt: 1 } }).then(async users => { + for (const user of users) { + if (guild.members.cache.find(m => m.id === user.id)) { + const userDate = new Date(user.birthdate); + const day = userDate.getDate(); + const month = userDate.getMonth(); + const year = userDate.getFullYear(); + const age = currentYear - year; - if (currentMonth === month && currentDay === day) { - const embed = new EmbedBuilder() - .setAuthor({ - name: client.user.username, - iconURL: client.user.displayAvatarURL({ - extension: "png", - size: 512, + if (currentMonth === month && currentDay === day) { + const embed = new EmbedBuilder() + .setAuthor({ + name: client.user.username, + iconURL: client.user.displayAvatarURL(), + }) + .setColor(client.config.embed.color) + .setFooter({ + text: client.config.embed.footer, + }) + .addFields([ + { + name: client.translate("economy/birthdate:HAPPY_BIRTHDAY"), + value: client.translate("economy/birthdate:HAPPY_BIRTHDAY_MESSAGE", { + name: user.username, + user: user.id, + age: `**${age}** ${client.functions.getNoun(age, client.translate("misc:NOUNS:AGE:1"), client.translate("misc:NOUNS:AGE:2"), client.translate("misc:NOUNS:AGE:5"))}`, }), - }) - .setColor(client.config.embed.color) - .setFooter({ - text: client.config.embed.footer, - }) - .addFields([ - { - name: client.translate("economy/birthdate:HAPPY_BIRTHDAY"), - value: client.translate("economy/birthdate:HAPPY_BIRTHDAY_MESSAGE", { - name: user.username, - user: user.id, - age: `**${age}** ${client.functions.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({ - embeds: [embed], - }); - await msg.react("🎉"); - } + const msg = await channel.send({ + embeds: [embed], + }); + await msg.react("🎉"); } } - }); + } + }); } } }); - }, null, true, "Europe/Moscow"); -}; \ No newline at end of file + }, + null, + true, + "Europe/Moscow", + ); +}; diff --git a/helpers/checkReminds.js b/helpers/checkReminds.js index 5bf50f94..8a538ccb 100644 --- a/helpers/checkReminds.js +++ b/helpers/checkReminds.js @@ -6,14 +6,12 @@ const moment = require("moment"); * @param {import("../base/JaBa")} client */ module.exports.init = function (client) { - client.usersData - .find({ reminds: { $gt: [] } }) - .then(users => { - for (const user of users) { - if (!client.users.cache.has(user.id)) client.users.fetch(user.id); - client.databaseCache.usersReminds.set(user.id, user); - } - }); + client.usersData.find({ reminds: { $gt: [] } }).then(users => { + 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(); @@ -30,9 +28,11 @@ module.exports.init = function (client) { .setAuthor({ name: client.translate("general/remindme:TITLE"), }) - .setDescription(client.translate("general/remindme:CREATED", { - time: moment(r.createdAt).locale(client.defaultLanguage).format("dddd, Do MMMM YYYY, HH:mm:ss"), - })) + .setDescription( + client.translate("general/remindme:CREATED", { + time: moment(r.createdAt).locale(client.defaultLanguage).format("dddd, Do MMMM YYYY, HH:mm:ss"), + }), + ) .addFields([ { name: client.translate("common:MESSAGE"), @@ -49,11 +49,11 @@ module.exports.init = function (client) { }); user.reminds = user.reminds.filter(r => r.sendAt >= dateNow); user.markModified("reminds"); - user.save(); + await user.save(); if (user.reminds.length === 0) client.databaseCache.usersReminds.delete(user.id); } } }); }, 1000); -}; \ No newline at end of file +}; diff --git a/helpers/cleanup.js b/helpers/cleanup.js index 6444811d..cab304e4 100644 --- a/helpers/cleanup.js +++ b/helpers/cleanup.js @@ -20,7 +20,7 @@ function setDaysTimeout(callback, days) { */ module.exports.init = async function (client) { setDaysTimeout(async () => { - const timestamp = Date.now() + (29 * 24 * 60 * 60 * 1000); // 29 days + const timestamp = Date.now() + 29 * 24 * 60 * 60 * 1000; // 29 days const members = client.membersData.find({ transactions: { $gt: [] } }); for (const member of members) { @@ -50,4 +50,4 @@ module.exports.init = async function (client) { } }); }, 30); -}; \ No newline at end of file +}; diff --git a/helpers/extenders.js b/helpers/extenders.js index bfb76961..9081db4f 100644 --- a/helpers/extenders.js +++ b/helpers/extenders.js @@ -56,4 +56,4 @@ Message.prototype.error = function (key, args, options = {}) { options.prefixEmoji = "error"; return this.replyT(key, args, options); -}; \ No newline at end of file +}; diff --git a/helpers/functions.js b/helpers/functions.js index 9aa8c8e7..59c144d4 100644 --- a/helpers/functions.js +++ b/helpers/functions.js @@ -18,7 +18,7 @@ module.exports = { async createInvite(client, guildId) { const guild = client.guilds.cache.get(guildId); const member = guild.members.me; - const channel = guild.channels.cache.find(ch => ch.permissionsFor(member.id).has(PermissionsBitField.Flags.CreateInstantInvite) && ch.type === ChannelType.GuildText || ch.type === "GUILD_VOICE"); + const channel = guild.channels.cache.find(ch => (ch.permissionsFor(member.id).has(PermissionsBitField.Flags.CreateInstantInvite) && ch.type === ChannelType.GuildText) || ch.type === "GUILD_VOICE"); if (channel) return (await channel.createInvite()).url || "No channels found or missing permissions"; }, @@ -46,7 +46,7 @@ module.exports = { return array.sort(function (a, b) { const x = a[key]; const y = b[key]; - return ((x < y) ? 1 : ((x > y) ? -1 : 0)); + return x < y ? 1 : x > y ? -1 : 0; }); }, @@ -59,7 +59,8 @@ module.exports = { const array = []; pArray.forEach(element => array.push(element)); let currentIndex = array.length, - temporaryValue, randomIndex; + temporaryValue, + randomIndex; while (currentIndex !== 0) { randomIndex = Math.floor(Math.random() * currentIndex); @@ -82,7 +83,6 @@ module.exports = { randomNum(min, max) { min = Math.ceil(min); max = Math.floor(max); - return Math.floor(Math.random() * (max - min + 1) + min); }, @@ -97,10 +97,7 @@ module.exports = { printDate(client, date, format = "", locale = client.defaultLanguage) { const languageData = client.languages.find(language => language.name === locale); if (format === "" || format === null) format = languageData.defaultMomentFormat; - - return moment(new Date(date)) - .locale(languageData.moment) - .format(format); + return moment(new Date(date)).locale(languageData.moment).format(format); }, /** @@ -115,8 +112,7 @@ module.exports = { convertTime(client, time, type = false, noPrefix = false, locale = this.defaultLanguage) { const languageData = client.languages.find(language => language.name === locale); const m = moment(time).locale(languageData.moment); - - return (type ? m.toNow(noPrefix) : m.fromNow(noPrefix)); + return type ? m.toNow(noPrefix) : m.fromNow(noPrefix); }, /** @@ -138,4 +134,4 @@ module.exports = { return five; }, -}; \ No newline at end of file +}; diff --git a/helpers/languages.js b/helpers/languages.js index becd1bdb..3419af95 100644 --- a/helpers/languages.js +++ b/helpers/languages.js @@ -49,4 +49,4 @@ module.exports = async () => { }); return new Map(languages.map(item => [item, i18next.getFixedT(item)])); -}; \ No newline at end of file +}; diff --git a/helpers/logger.js b/helpers/logger.js index a9fb810e..3962121e 100644 --- a/helpers/logger.js +++ b/helpers/logger.js @@ -8,13 +8,21 @@ function dateTimePad(value, digits) { } function format(tDate) { - return (dateTimePad((tDate.getDate()), 2) + "-" + - dateTimePad((tDate.getMonth() + 1), 2) + "-" + - dateTimePad(tDate.getFullYear(), 2) + " " + - dateTimePad(tDate.getHours(), 2) + ":" + - dateTimePad(tDate.getMinutes(), 2) + ":" + - dateTimePad(tDate.getSeconds(), 2) + "." + - dateTimePad(tDate.getMilliseconds(), 3)); + return ( + dateTimePad(tDate.getDate(), 2) + + "-" + + dateTimePad(tDate.getMonth() + 1, 2) + + "-" + + dateTimePad(tDate.getFullYear(), 2) + + " " + + dateTimePad(tDate.getHours(), 2) + + ":" + + dateTimePad(tDate.getMinutes(), 2) + + ":" + + dateTimePad(tDate.getSeconds(), 2) + + "." + + dateTimePad(tDate.getMilliseconds(), 3) + ); } module.exports = class Logger { @@ -49,4 +57,4 @@ module.exports = class Logger { 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/mee6-api.js b/helpers/mee6-api.js index ae221a95..a90a00f7 100644 --- a/helpers/mee6-api.js +++ b/helpers/mee6-api.js @@ -20,10 +20,8 @@ class Mee6Api { * @returns {String} ID of the guild or user. */ static getId(guildOrUser) { - if (typeof guildOrUser === "string") - return guildOrUser; - else if (typeof guildOrUser.id === "string") - return guildOrUser.id; + if (typeof guildOrUser === "string") return guildOrUser; + else if (typeof guildOrUser.id === "string") return guildOrUser.id; else throw new Error("Invalid Id specified."); } @@ -35,6 +33,7 @@ class Mee6Api { static async getRoleRewards(guild) { const guildId = this.getId(guild); const { role_rewards } = await fetchMee6(`${guildId}?limit=1`); + return role_rewards.sort((a, b) => a.rank - b.rank).map(({ rank, ...rest }) => ({ ...rest, level: rank })); } @@ -52,11 +51,17 @@ class Mee6Api { const { id, level, username, discriminator, avatar, message_count: messageCount } = user; const avatarUrl = `https://cdn.discordapp.com/avatars/${id}/${avatar}`; const [userXp, levelXp, totalXp] = user.detailed_xp; + return { - id, level, username, discriminator, avatarUrl, messageCount, + id, + level, + username, + discriminator, + avatarUrl, + messageCount, tag: `${username}#${discriminator}`, xp: { userXp, levelXp, totalXp }, - rank: (limit * page) + index + 1, + rank: limit * page + index + 1, }; }); } @@ -68,13 +73,16 @@ class Mee6Api { */ static async getLeaderboard(guild) { const leaderboard = []; - let pageNumber = 0, page; + let pageNumber = 0, + page; + while (true) { page = await this.getLeaderboardPage(guild, 1000, pageNumber); leaderboard.push(...page); if (page.length < 1000) break; pageNumber += 1; } + return leaderboard; } @@ -86,15 +94,19 @@ class Mee6Api { */ static async getUserXp(guild, user) { const userId = this.getId(user); - let pageNumber = 0, page, userInfo; + let pageNumber = 0, + page, + userInfo; + while (true) { page = await this.getLeaderboardPage(guild, 1000, pageNumber); userInfo = page.find(u => u.id === userId); if (page.length < 1000 || userInfo) break; pageNumber += 1; } + return userInfo; } } -module.exports = Mee6Api; \ No newline at end of file +module.exports = Mee6Api; diff --git a/helpers/tictactoe.js b/helpers/tictactoe.js index 018504f1..2faeec2e 100644 --- a/helpers/tictactoe.js +++ b/helpers/tictactoe.js @@ -19,7 +19,7 @@ const { EmbedBuilder, ButtonBuilder, ActionRowBuilder, ButtonStyle, ComponentTyp */ async function tictactoe(interaction, options = {}) { // eslint-disable-next-line no-async-promise-executor - return new Promise(async (resolve) => { + return new Promise(async resolve => { try { const { client } = interaction; let opponent; @@ -68,9 +68,11 @@ async function tictactoe(interaction, options = {}) { user = interaction.user ? interaction.user : interaction.author; const acceptEmbed = new EmbedBuilder() - .setTitle(interaction.translate("fun/tictactoe:REQUEST_WAIT", { - user: opponent.getUsername(), - })) + .setTitle( + interaction.translate("fun/tictactoe:REQUEST_WAIT", { + user: opponent.getUsername(), + }), + ) .setAuthor({ name: user.getUsername(), iconURL: user.displayAvatarURL(), @@ -79,39 +81,31 @@ async function tictactoe(interaction, options = {}) { .setFooter(foot) .setTimestamp(); - const accept = new ButtonBuilder() - .setLabel(interaction.translate("common:ACCEPT")) - .setStyle(ButtonStyle.Success) - .setCustomId("acceptttt"); - - const decline = new ButtonBuilder() - .setLabel(interaction.translate("common:DECLINE")) - .setStyle(ButtonStyle.Danger) - .setCustomId("declinettt"); - - const accep = new ActionRowBuilder().addComponents([ - accept, - decline, - ]); + const accept = new ButtonBuilder().setLabel(interaction.translate("common:ACCEPT")).setStyle(ButtonStyle.Success).setCustomId("acceptttt"); + const decline = new ButtonBuilder().setLabel(interaction.translate("common:DECLINE")).setStyle(ButtonStyle.Danger).setCustomId("declinettt"); + const accep = new ActionRowBuilder().addComponents([accept, decline]); let m; - if (interaction.commandId) m = await interaction.reply({ - content: interaction.translate("fun/tictactoe:INVITE_USER", { - opponent: opponent.id, - }), - embeds: [acceptEmbed], - components: [accep], - }); else if (!interaction.commandId) m = await interaction.reply({ - content: interaction.translate("fun/tictactoe:INVITE_USER", { - opponent: opponent.id, - }), - embeds: [acceptEmbed], - components: [accep], - }); + if (interaction.commandId) + m = await interaction.reply({ + content: interaction.translate("fun/tictactoe:INVITE_USER", { + opponent: opponent.id, + }), + embeds: [acceptEmbed], + components: [accep], + }); + else if (!interaction.commandId) + m = await interaction.reply({ + content: interaction.translate("fun/tictactoe:INVITE_USER", { + opponent: opponent.id, + }), + embeds: [acceptEmbed], + components: [accep], + }); const collector = m.createMessageComponentCollector({ componentType: ComponentType.Button, - time: (30 * 1000), + time: 30 * 1000, }); collector.on("collect", async button => { if (button.user.id !== opponent.id) @@ -129,10 +123,7 @@ async function tictactoe(interaction, options = {}) { button.deferUpdate(); collector.stop(); - const fighters = [ - (interaction.user ? interaction.user : interaction.author).id, - opponent.id, - ].sort(() => (Math.random() > 0.5 ? 1 : -1)); + const fighters = [(interaction.user ? interaction.user : interaction.author).id, opponent.id].sort(() => (Math.random() > 0.5 ? 1 : -1)); const x_emoji = options.xEmoji || "❌"; const o_emoji = options.oEmoji || "⭕"; @@ -195,25 +186,28 @@ async function tictactoe(interaction, options = {}) { .setTimestamp(); let msg; - if (interaction.commandId) msg = await interaction.editReply({ - embeds: [ - epm.setDescription( - interaction.translate("fun/tictactoe:WAITING", { - user: Args.userid, - emoji: client.emojis.cache.get(o_emoji) || "⭕", - }), - ), - ], - }); else if (!interaction.commandId) msg = await button.message.edit({ - embeds: [ - epm.setDescription( - interaction.translate("fun/tictactoe:WAITING", { - user: Args.userid, - emoji: client.emojis.cache.get(o_emoji) || "⭕", - }), - ), - ], - }); + if (interaction.commandId) + msg = await interaction.editReply({ + embeds: [ + epm.setDescription( + interaction.translate("fun/tictactoe:WAITING", { + user: Args.userid, + emoji: client.emojis.cache.get(o_emoji) || "⭕", + }), + ), + ], + }); + else if (!interaction.commandId) + msg = await button.message.edit({ + embeds: [ + epm.setDescription( + interaction.translate("fun/tictactoe:WAITING", { + user: Args.userid, + emoji: client.emojis.cache.get(o_emoji) || "⭕", + }), + ), + ], + }); await ttt(msg); @@ -225,109 +219,39 @@ async function tictactoe(interaction, options = {}) { "<:X_:863314044781723668>": false, }; - const a1 = new ButtonBuilder() - .setStyle(Args.a1.style) - .setEmoji(Args.a1.emoji) - .setCustomId("a1") - .setDisabled(Args.a1.disabled); - const a2 = new ButtonBuilder() - .setStyle(Args.a2.style) - .setEmoji(Args.a2.emoji) - .setCustomId("a2") - .setDisabled(Args.a2.disabled); - const a3 = new ButtonBuilder() - .setStyle(Args.a3.style) - .setEmoji(Args.a3.emoji) - .setCustomId("a3") - .setDisabled(Args.a3.disabled); - const b1 = new ButtonBuilder() - .setStyle(Args.b1.style) - .setEmoji(Args.b1.emoji) - .setCustomId("b1") - .setDisabled(Args.b1.disabled); - const b2 = new ButtonBuilder() - .setStyle(Args.b2.style) - .setEmoji(Args.b2.emoji) - .setCustomId("b2") - .setDisabled(Args.b2.disabled); - const b3 = new ButtonBuilder() - .setStyle(Args.b3.style) - .setEmoji(Args.b3.emoji) - .setCustomId("b3") - .setDisabled(Args.b3.disabled); - const c1 = new ButtonBuilder() - .setStyle(Args.c1.style) - .setEmoji(Args.c1.emoji) - .setCustomId("c1") - .setDisabled(Args.c1.disabled); - const c2 = new ButtonBuilder() - .setStyle(Args.c2.style) - .setEmoji(Args.c2.emoji) - .setCustomId("c2") - .setDisabled(Args.c2.disabled); - const c3 = new ButtonBuilder() - .setStyle(Args.c3.style) - .setEmoji(Args.c3.emoji) - .setCustomId("c3") - .setDisabled(Args.c3.disabled); + const a1 = new ButtonBuilder().setStyle(Args.a1.style).setEmoji(Args.a1.emoji).setCustomId("a1").setDisabled(Args.a1.disabled); + const a2 = new ButtonBuilder().setStyle(Args.a2.style).setEmoji(Args.a2.emoji).setCustomId("a2").setDisabled(Args.a2.disabled); + const a3 = new ButtonBuilder().setStyle(Args.a3.style).setEmoji(Args.a3.emoji).setCustomId("a3").setDisabled(Args.a3.disabled); + const b1 = new ButtonBuilder().setStyle(Args.b1.style).setEmoji(Args.b1.emoji).setCustomId("b1").setDisabled(Args.b1.disabled); + const b2 = new ButtonBuilder().setStyle(Args.b2.style).setEmoji(Args.b2.emoji).setCustomId("b2").setDisabled(Args.b2.disabled); + const b3 = new ButtonBuilder().setStyle(Args.b3.style).setEmoji(Args.b3.emoji).setCustomId("b3").setDisabled(Args.b3.disabled); + const c1 = new ButtonBuilder().setStyle(Args.c1.style).setEmoji(Args.c1.emoji).setCustomId("c1").setDisabled(Args.c1.disabled); + const c2 = new ButtonBuilder().setStyle(Args.c2.style).setEmoji(Args.c2.emoji).setCustomId("c2").setDisabled(Args.c2.disabled); + const c3 = new ButtonBuilder().setStyle(Args.c3.style).setEmoji(Args.c3.emoji).setCustomId("c3").setDisabled(Args.c3.disabled); const a = new ActionRowBuilder().addComponents([a1, a2, a3]); const b = new ActionRowBuilder().addComponents([b1, b2, b3]); const c = new ActionRowBuilder().addComponents([c1, c2, c3]); const buttons = [a, b, c]; - if ( - Args.a1.emoji == o_emoji && - Args.b1.emoji == o_emoji && - Args.c1.emoji == o_emoji - ) won["<:O_:863314110560993340>"] = true; + if (Args.a1.emoji == o_emoji && Args.b1.emoji == o_emoji && Args.c1.emoji == o_emoji) won["<:O_:863314110560993340>"] = true; - if ( - Args.a2.emoji == o_emoji && - Args.b2.emoji == o_emoji && - Args.c2.emoji == o_emoji - ) won["<:O_:863314110560993340>"] = true; + if (Args.a2.emoji == o_emoji && Args.b2.emoji == o_emoji && Args.c2.emoji == o_emoji) won["<:O_:863314110560993340>"] = true; - if ( - Args.a3.emoji == o_emoji && - Args.b3.emoji == o_emoji && - Args.c3.emoji == o_emoji - ) won["<:O_:863314110560993340>"] = true; + if (Args.a3.emoji == o_emoji && Args.b3.emoji == o_emoji && Args.c3.emoji == o_emoji) won["<:O_:863314110560993340>"] = true; - if ( - Args.a1.emoji == o_emoji && - Args.b2.emoji == o_emoji && - Args.c3.emoji == o_emoji - ) won["<:O_:863314110560993340>"] = true; + if (Args.a1.emoji == o_emoji && Args.b2.emoji == o_emoji && Args.c3.emoji == o_emoji) won["<:O_:863314110560993340>"] = true; - if ( - Args.a3.emoji == o_emoji && - Args.b2.emoji == o_emoji && - Args.c1.emoji == o_emoji - ) won["<:O_:863314110560993340>"] = true; + if (Args.a3.emoji == o_emoji && Args.b2.emoji == o_emoji && Args.c1.emoji == o_emoji) won["<:O_:863314110560993340>"] = true; - if ( - Args.a1.emoji == o_emoji && - Args.a2.emoji == o_emoji && - Args.a3.emoji == o_emoji - ) won["<:O_:863314110560993340>"] = true; + if (Args.a1.emoji == o_emoji && Args.a2.emoji == o_emoji && Args.a3.emoji == o_emoji) won["<:O_:863314110560993340>"] = true; - if ( - Args.b1.emoji == o_emoji && - Args.b2.emoji == o_emoji && - Args.b3.emoji == o_emoji - ) won["<:O_:863314110560993340>"] = true; + if (Args.b1.emoji == o_emoji && Args.b2.emoji == o_emoji && Args.b3.emoji == o_emoji) won["<:O_:863314110560993340>"] = true; - if ( - Args.c1.emoji == o_emoji && - Args.c2.emoji == o_emoji && - Args.c3.emoji == o_emoji - ) won["<:O_:863314110560993340>"] = true; + if (Args.c1.emoji == o_emoji && Args.c2.emoji == o_emoji && Args.c3.emoji == o_emoji) won["<:O_:863314110560993340>"] = true; if (won["<:O_:863314110560993340>"] != false) if (Args.user == 0) { - const wonner = await client.users - .fetch(fighters[1]) - .catch(console.error); + const wonner = await client.users.fetch(fighters[1]).catch(console.error); resolve(wonner); if (options.resultBtn === true) @@ -364,28 +288,13 @@ async function tictactoe(interaction, options = {}) { `${interaction.translate("fun/tictactoe:WON", { winner: fighters[1], emoji: client.emojis.cache.get(o_emoji) || "⭕", - })}\n\`\`\`\n${Args.a1.emoji + })}\n\`\`\`\n${Args.a1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.a2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.a3.emoji .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.a2.emoji + .replace(x_emoji, "❌")}\n${Args.b1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.b2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.b3.emoji .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.a3.emoji + .replace(x_emoji, "❌")}\n${Args.c1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.c2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.c3.emoji .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")}\n${Args.b1.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.b2.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.b3.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")}\n${Args.c1.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.c2.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.c3.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")}\n\`\`\``.replaceAll( - dashmoji, - "➖", - ), + .replace(x_emoji, "❌")}\n\`\`\``.replaceAll(dashmoji, "➖"), ), ], components: [], @@ -394,9 +303,7 @@ async function tictactoe(interaction, options = {}) { m.react("⭕"); }); } else if (Args.user == 1) { - const wonner = await client.users - .fetch(fighters[0]) - .catch(console.error); + const wonner = await client.users.fetch(fighters[0]).catch(console.error); resolve(wonner); if (options.resultBtn === true) @@ -432,28 +339,13 @@ async function tictactoe(interaction, options = {}) { `${interaction.translate("fun/tictactoe:WON", { winner: fighters[0], emoji: client.emojis.cache.get(o_emoji) || "⭕", - })}\n\`\`\`\n${Args.a1.emoji + })}\n\`\`\`\n${Args.a1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.a2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.a3.emoji .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.a2.emoji + .replace(x_emoji, "❌")}\n${Args.b1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.b2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.b3.emoji .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.a3.emoji + .replace(x_emoji, "❌")}\n${Args.c1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.c2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.c3.emoji .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")}\n${Args.b1.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.b2.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.b3.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")}\n${Args.c1.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.c2.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.c3.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")}\n\`\`\``.replaceAll( - dashmoji, - "➖", - ), + .replace(x_emoji, "❌")}\n\`\`\``.replaceAll(dashmoji, "➖"), ), ], components: [], @@ -463,59 +355,17 @@ async function tictactoe(interaction, options = {}) { }); } - if ( - Args.a1.emoji == x_emoji && - Args.b1.emoji == x_emoji && - Args.c1.emoji == x_emoji - ) - won["<:X_:863314044781723668>"] = true; - if ( - Args.a2.emoji == x_emoji && - Args.b2.emoji == x_emoji && - Args.c2.emoji == x_emoji - ) - won["<:X_:863314044781723668>"] = true; - if ( - Args.a3.emoji == x_emoji && - Args.b3.emoji == x_emoji && - Args.c3.emoji == x_emoji - ) - won["<:X_:863314044781723668>"] = true; - if ( - Args.a1.emoji == x_emoji && - Args.b2.emoji == x_emoji && - Args.c3.emoji == x_emoji - ) - won["<:X_:863314044781723668>"] = true; - if ( - Args.a3.emoji == x_emoji && - Args.b2.emoji == x_emoji && - Args.c1.emoji == x_emoji - ) - won["<:X_:863314044781723668>"] = true; - if ( - Args.a1.emoji == x_emoji && - Args.a2.emoji == x_emoji && - Args.a3.emoji == x_emoji - ) - won["<:X_:863314044781723668>"] = true; - if ( - Args.b1.emoji == x_emoji && - Args.b2.emoji == x_emoji && - Args.b3.emoji == x_emoji - ) - won["<:X_:863314044781723668>"] = true; - if ( - Args.c1.emoji == x_emoji && - Args.c2.emoji == x_emoji && - Args.c3.emoji == x_emoji - ) - won["<:X_:863314044781723668>"] = true; + if (Args.a1.emoji == x_emoji && Args.b1.emoji == x_emoji && Args.c1.emoji == x_emoji) won["<:X_:863314044781723668>"] = true; + if (Args.a2.emoji == x_emoji && Args.b2.emoji == x_emoji && Args.c2.emoji == x_emoji) won["<:X_:863314044781723668>"] = true; + if (Args.a3.emoji == x_emoji && Args.b3.emoji == x_emoji && Args.c3.emoji == x_emoji) won["<:X_:863314044781723668>"] = true; + if (Args.a1.emoji == x_emoji && Args.b2.emoji == x_emoji && Args.c3.emoji == x_emoji) won["<:X_:863314044781723668>"] = true; + if (Args.a3.emoji == x_emoji && Args.b2.emoji == x_emoji && Args.c1.emoji == x_emoji) won["<:X_:863314044781723668>"] = true; + if (Args.a1.emoji == x_emoji && Args.a2.emoji == x_emoji && Args.a3.emoji == x_emoji) won["<:X_:863314044781723668>"] = true; + if (Args.b1.emoji == x_emoji && Args.b2.emoji == x_emoji && Args.b3.emoji == x_emoji) won["<:X_:863314044781723668>"] = true; + if (Args.c1.emoji == x_emoji && Args.c2.emoji == x_emoji && Args.c3.emoji == x_emoji) won["<:X_:863314044781723668>"] = true; if (won["<:X_:863314044781723668>"] != false) if (Args.user == 0) { - const wonner = await client.users - .fetch(fighters[1]) - .catch(console.error); + const wonner = await client.users.fetch(fighters[1]).catch(console.error); resolve(wonner); if (options.resultBtn === true) @@ -550,28 +400,13 @@ async function tictactoe(interaction, options = {}) { `${interaction.translate("fun/tictactoe:WON", { winner: fighters[1], emoji: client.emojis.cache.get(o_emoji) || "⭕", - })}\n\`\`\`\n${Args.a1.emoji + })}\n\`\`\`\n${Args.a1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.a2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.a3.emoji .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.a2.emoji + .replace(x_emoji, "❌")}\n${Args.b1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.b2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.b3.emoji .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.a3.emoji + .replace(x_emoji, "❌")}\n${Args.c1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.c2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.c3.emoji .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")}\n${Args.b1.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.b2.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.b3.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")}\n${Args.c1.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.c2.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.c3.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")}\n\`\`\``.replaceAll( - dashmoji, - "➖", - ), + .replace(x_emoji, "❌")}\n\`\`\``.replaceAll(dashmoji, "➖"), ), ], components: [], @@ -580,9 +415,7 @@ async function tictactoe(interaction, options = {}) { m.react("❌"); }); } else if (Args.user == 1) { - const wonner = await client.users - .fetch(fighters[0]) - .catch(console.error); + const wonner = await client.users.fetch(fighters[0]).catch(console.error); resolve(wonner); if (options.resultBtn === true) @@ -617,28 +450,13 @@ async function tictactoe(interaction, options = {}) { `${interaction.translate("fun/tictactoe:WON", { winner: fighters[0], emoji: client.emojis.cache.get(o_emoji) || "⭕", - })}\n\`\`\`\n${Args.a1.emoji + })}\n\`\`\`\n${Args.a1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.a2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.a3.emoji .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.a2.emoji + .replace(x_emoji, "❌")}\n${Args.b1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.b2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.b3.emoji .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.a3.emoji + .replace(x_emoji, "❌")}\n${Args.c1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.c2.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.c3.emoji .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")}\n${Args.b1.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.b2.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.b3.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")}\n${Args.c1.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.c2.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.c3.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")}\n\`\`\``.replaceAll( - dashmoji, - "➖", - ), + .replace(x_emoji, "❌")}\n\`\`\``.replaceAll(dashmoji, "➖"), ), ], components: [], @@ -648,7 +466,6 @@ async function tictactoe(interaction, options = {}) { }); } - m.edit({ content: `<@${Args.userid}>`, embeds: [ @@ -697,7 +514,8 @@ async function tictactoe(interaction, options = {}) { (prev, [key, value]) => ({ ...prev, [key]: fun(key, value), - }), {}, + }), + {}, ); const objectFilter = (obj, predicate) => Object.keys(obj) @@ -705,58 +523,18 @@ async function tictactoe(interaction, options = {}) { .reduce((res, key) => ((res[key] = obj[key]), res), {}); const Brgs = objectFilter( map(Args, (_, fruit) => fruit.emoji == dashmoji), - (num) => num == true, + num => num == true, ); if (Object.keys(Brgs).length == 0) { - if ( - Args.a1.emoji == o_emoji && - Args.b1.emoji == o_emoji && - Args.c1.emoji == o_emoji - ) - won["<:O_:863314110560993340>"] = true; - if ( - Args.a2.emoji == o_emoji && - Args.b2.emoji == o_emoji && - Args.c2.emoji == o_emoji - ) - won["<:O_:863314110560993340>"] = true; - if ( - Args.a3.emoji == o_emoji && - Args.b3.emoji == o_emoji && - Args.c3.emoji == o_emoji - ) - won["<:O_:863314110560993340>"] = true; - if ( - Args.a1.emoji == o_emoji && - Args.b2.emoji == o_emoji && - Args.c3.emoji == o_emoji - ) - won["<:O_:863314110560993340>"] = true; - if ( - Args.a3.emoji == o_emoji && - Args.b2.emoji == o_emoji && - Args.c1.emoji == o_emoji - ) - won["<:O_:863314110560993340>"] = true; - if ( - Args.a1.emoji == o_emoji && - Args.a2.emoji == o_emoji && - Args.a3.emoji == o_emoji - ) - won["<:O_:863314110560993340>"] = true; - if ( - Args.b1.emoji == o_emoji && - Args.b2.emoji == o_emoji && - Args.b3.emoji == o_emoji - ) - won["<:O_:863314110560993340>"] = true; - if ( - Args.c1.emoji == o_emoji && - Args.c2.emoji == o_emoji && - Args.c3.emoji == o_emoji - ) - won["<:O_:863314110560993340>"] = true; + if (Args.a1.emoji == o_emoji && Args.b1.emoji == o_emoji && Args.c1.emoji == o_emoji) won["<:O_:863314110560993340>"] = true; + if (Args.a2.emoji == o_emoji && Args.b2.emoji == o_emoji && Args.c2.emoji == o_emoji) won["<:O_:863314110560993340>"] = true; + if (Args.a3.emoji == o_emoji && Args.b3.emoji == o_emoji && Args.c3.emoji == o_emoji) won["<:O_:863314110560993340>"] = true; + if (Args.a1.emoji == o_emoji && Args.b2.emoji == o_emoji && Args.c3.emoji == o_emoji) won["<:O_:863314110560993340>"] = true; + if (Args.a3.emoji == o_emoji && Args.b2.emoji == o_emoji && Args.c1.emoji == o_emoji) won["<:O_:863314110560993340>"] = true; + if (Args.a1.emoji == o_emoji && Args.a2.emoji == o_emoji && Args.a3.emoji == o_emoji) won["<:O_:863314110560993340>"] = true; + if (Args.b1.emoji == o_emoji && Args.b2.emoji == o_emoji && Args.b3.emoji == o_emoji) won["<:O_:863314110560993340>"] = true; + if (Args.c1.emoji == o_emoji && Args.c2.emoji == o_emoji && Args.c3.emoji == o_emoji) won["<:O_:863314110560993340>"] = true; if (won["<:O_:863314110560993340>"] == true) return ttt(m); else if (won["<:X_:863314044781723668>"] == true) return; @@ -778,28 +556,13 @@ async function tictactoe(interaction, options = {}) { content: interaction.translate("fun/tictactoe:TIE"), embeds: [ epm.setDescription( - `${interaction.translate("fun/tictactoe:TIE_DESC")}!\n\`\`\`\n${Args.a1.emoji + `${interaction.translate("fun/tictactoe:TIE_DESC")}!\n\`\`\`\n${Args.a1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.a2.emoji .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.a2.emoji + .replace(x_emoji, "❌")} | ${Args.a3.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")}\n${Args.b1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.b2.emoji .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.a3.emoji + .replace(x_emoji, "❌")} | ${Args.b3.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")}\n${Args.c1.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")} | ${Args.c2.emoji .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")}\n${Args.b1.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.b2.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.b3.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")}\n${Args.c1.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.c2.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")} | ${Args.c3.emoji - .replace(o_emoji, "⭕") - .replace(x_emoji, "❌")}\n\`\`\``.replaceAll( - dashmoji, - "➖", - ), + .replace(x_emoji, "❌")} | ${Args.c3.emoji.replace(o_emoji, "⭕").replace(x_emoji, "❌")}\n\`\`\``.replaceAll(dashmoji, "➖"), ), ], components: [], @@ -857,9 +620,11 @@ async function tictactoe(interaction, options = {}) { .setColor(options.timeoutEmbedColor || "#C90000") .setFooter(foot) .setTimestamp() - .setDescription(interaction.translate("fun/tictactoe:CANCELED_DESC", { - user: opponent.id, - })); + .setDescription( + interaction.translate("fun/tictactoe:CANCELED_DESC", { + user: opponent.id, + }), + ); m.interaction.editReply({ embeds: [embed], components: [], @@ -872,4 +637,4 @@ async function tictactoe(interaction, options = {}) { }); } -module.exports = tictactoe; \ No newline at end of file +module.exports = tictactoe; diff --git a/package.json b/package.json index 4d6aa821..27f25701 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "cron": "^2.1.0", "dbd-soft-ui": "^1.6.48-beta.1", "discord-api-types": "^0.37.47", - "discord-dashboard": "^2.3.61", "discord-giveaways": "^6.0.1", "discord-player": "^6.6.0", "discord.js": "^14.11.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index aad31338..e58ef2f5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -32,9 +32,6 @@ dependencies: discord-api-types: specifier: ^0.37.47 version: 0.37.47 - discord-dashboard: - specifier: ^2.3.61 - version: 2.3.61 discord-giveaways: specifier: ^6.0.1 version: 6.0.1(discord.js@14.11.0) @@ -367,10 +364,6 @@ packages: engines: {node: '>=14.16'} dev: false - /@socket.io/component-emitter@3.1.0: - resolution: {integrity: sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==} - dev: false - /@szmarczak/http-timer@5.0.1: resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} engines: {node: '>=14.16'} @@ -394,16 +387,6 @@ packages: '@types/node': 20.3.3 dev: false - /@types/cookie@0.4.1: - resolution: {integrity: sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==} - dev: false - - /@types/cors@2.8.13: - resolution: {integrity: sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==} - dependencies: - '@types/node': 20.3.3 - dev: false - /@types/http-cache-semantics@4.0.1: resolution: {integrity: sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==} dev: false @@ -434,14 +417,6 @@ packages: resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} dev: false - /accepts@1.3.8: - resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} - engines: {node: '>= 0.6'} - dependencies: - mime-types: 2.1.35 - negotiator: 0.6.3 - dev: false - /acorn-jsx@5.3.2(acorn@8.9.0): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -539,25 +514,11 @@ packages: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} dev: true - /array-flatten@1.1.1: - resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} - dev: false - /array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} dev: true - /assistants-safe-storage@1.0.0: - resolution: {integrity: sha512-3bFR7KvTKRyTj5b0omvYjDBjSU/kM8czl330mUcJKYLbH0zLQbRy/dL1PvCoKtJCi0c65Vrp2jBpYNDCZpy5uA==} - dependencies: - cryptr: 6.2.0 - dev: false - - /async@3.2.4: - resolution: {integrity: sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==} - dev: false - /axios@0.22.0: resolution: {integrity: sha512-Z0U3uhqQeg1oNcihswf4ZD57O3NrR1+ZXhxaROaWpDmsDTx7T2HNBV2ulBtie2hwJptu8UvgnJoK+BIqdzh/1w==} dependencies: @@ -579,11 +540,6 @@ packages: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} dev: false - /base64id@2.0.0: - resolution: {integrity: sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==} - engines: {node: ^4.5.0 || >= 5.9} - dev: false - /better-sqlite3@7.6.2: resolution: {integrity: sha512-S5zIU1Hink2AH4xPsN0W43T1/AJ5jrPh7Oy07ocuW/AKYYY02GWzz9NH0nbSMn/gw6fDZ5jZ1QsHt1BXAwJ6Lg==} requiresBuild: true @@ -617,46 +573,6 @@ packages: resolution: {integrity: sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==} dev: false - /body-parser@1.20.1: - resolution: {integrity: sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==} - engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} - dependencies: - bytes: 3.1.2 - content-type: 1.0.5 - debug: 2.6.9 - depd: 2.0.0 - destroy: 1.2.0 - http-errors: 2.0.0 - iconv-lite: 0.4.24 - on-finished: 2.4.1 - qs: 6.11.0 - raw-body: 2.5.1 - type-is: 1.6.18 - unpipe: 1.0.0 - transitivePeerDependencies: - - supports-color - dev: false - - /body-parser@1.20.2: - resolution: {integrity: sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==} - engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} - dependencies: - bytes: 3.1.2 - content-type: 1.0.5 - debug: 2.6.9 - depd: 2.0.0 - destroy: 1.2.0 - http-errors: 2.0.0 - iconv-lite: 0.4.24 - on-finished: 2.4.1 - qs: 6.11.0 - raw-body: 2.5.2 - type-is: 1.6.18 - unpipe: 1.0.0 - transitivePeerDependencies: - - supports-color - dev: false - /boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} dev: false @@ -667,12 +583,6 @@ packages: balanced-match: 1.0.2 concat-map: 0.0.1 - /brace-expansion@2.0.1: - resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} - dependencies: - balanced-match: 1.0.2 - dev: false - /braces@3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} @@ -699,11 +609,6 @@ packages: streamsearch: 1.1.0 dev: false - /bytes@3.1.2: - resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} - engines: {node: '>= 0.8'} - dev: false - /cacache@15.3.0: resolution: {integrity: sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==} engines: {node: '>= 10'} @@ -749,13 +654,6 @@ packages: responselike: 3.0.0 dev: false - /call-bind@1.0.2: - resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} - dependencies: - function-bind: 1.1.1 - get-intrinsic: 1.2.1 - dev: false - /callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -865,57 +763,10 @@ packages: resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} dev: false - /content-disposition@0.5.4: - resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} - engines: {node: '>= 0.6'} - dependencies: - safe-buffer: 5.2.1 - dev: false - - /content-type@1.0.5: - resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} - engines: {node: '>= 0.6'} - dev: false - - /cookie-parser@1.4.6: - resolution: {integrity: sha512-z3IzaNjdwUC2olLIB5/ITd0/setiaFMLYiZJle7xg5Fe9KWAceil7xszYfHHBtDFYLSgJduS2Ty0P1uJdPDJeA==} - engines: {node: '>= 0.8.0'} - dependencies: - cookie: 0.4.1 - cookie-signature: 1.0.6 - dev: false - - /cookie-signature@1.0.6: - resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} - dev: false - - /cookie@0.4.1: - resolution: {integrity: sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==} - engines: {node: '>= 0.6'} - dev: false - - /cookie@0.4.2: - resolution: {integrity: sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==} - engines: {node: '>= 0.6'} - dev: false - - /cookie@0.5.0: - resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} - engines: {node: '>= 0.6'} - dev: false - /core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} dev: false - /cors@2.8.5: - resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==} - engines: {node: '>= 0.10'} - dependencies: - object-assign: 4.1.1 - vary: 1.1.2 - dev: false - /cron@2.1.0: resolution: {integrity: sha512-Hq7u3P8y7UWYvsZbSKHHJDVG0VO9O7tp2qljxzTScelcTODBfCme8AIhnZsFwmQ9NchZ3hr2uNr+s3DSms7q6w==} dependencies: @@ -935,10 +786,6 @@ packages: resolution: {integrity: sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==} dev: false - /cryptr@6.2.0: - resolution: {integrity: sha512-jYi8SxvOFebTT7EYOABiPpHKY6lwWaP9IVcvT/aIVJUVoFdzTgi0ySPCL78q1ig8w2kwfXFCZACXoCXaye57aw==} - dev: false - /css-select@5.1.0: resolution: {integrity: sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==} dependencies: @@ -971,17 +818,6 @@ packages: dev: false bundledDependencies: [] - /debug@2.6.9: - resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.0.0 - dev: false - /debug@3.1.0: resolution: {integrity: sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==} peerDependencies: @@ -1050,11 +886,7 @@ packages: resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} engines: {node: '>= 0.8'} dev: false - - /destroy@1.2.0: - resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} - engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} - dev: false + optional: true /detect-libc@2.0.1: resolution: {integrity: sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==} @@ -1072,40 +904,6 @@ packages: resolution: {integrity: sha512-rNif8IAv6duS2z47BMXq/V9kkrLfkAoiwpFY3sLxxbyKprk065zqf3HLTg4bEoxRSmi+Lhc7yqGDrG8C3j8GFA==} dev: false - /discord-dashboard-pp-system@1.0.2: - resolution: {integrity: sha512-vc209e4/VCZyd2B14wdmrnihZoyJDBX/es3a9sAw1q1jn/6DR8BwTPNjF4sIYKPI71y2R6N56NhT4EgXgK+/qg==} - dependencies: - uuid: 8.3.2 - dev: false - - /discord-dashboard@2.3.61: - resolution: {integrity: sha512-eKOCNUd4aAK7WwfGJRFKT1HVAgXfVrSdEkalstC4krt9tsQFW2QZpwtxHEFcsKn7ewvV+EaE6cAeFFryp2TGhQ==} - dependencies: - assistants-safe-storage: 1.0.0 - body-parser: 1.20.2 - colors: 1.4.0 - cookie-parser: 1.4.6 - discord-dashboard-pp-system: 1.0.2 - discord-oauth2: 2.11.0 - discord.js: 14.11.0 - ejs: 3.1.9 - express: 4.18.2 - express-partials: 0.3.0 - express-rate-limit: 6.7.0(express@4.18.2) - express-session: 1.17.3 - https: 1.0.0 - keyv: 4.5.2 - node-fetch: 2.6.12 - readline-sync: 1.4.10 - socket.io: 4.7.1 - uuid: 8.3.2 - transitivePeerDependencies: - - bufferutil - - encoding - - supports-color - - utf-8-validate - dev: false - /discord-giveaways@6.0.1(discord.js@14.11.0): resolution: {integrity: sha512-hs6Vtb62VdlV7NfB93Phaxc8FW0cH4N1Nkb0bXVZ2npgn73yGOFVmdp8bBP5gsC2ady9OAXXI8Gb66t1IddkFw==} engines: {node: '>=16.9.0'} @@ -1117,10 +915,6 @@ packages: serialize-javascript: 6.0.1 dev: false - /discord-oauth2@2.11.0: - resolution: {integrity: sha512-pIbgXm498f7vqNd8/7JwoLd36YMFOFASSJdqyCGdwQpaG7ULHu9nLyifpVXI1b88xvNLqQwqugS8jxkn8Ypd1Q==} - dev: false - /discord-player@6.6.0(@discord-player/extractor@4.3.1)(@discordjs/opus@0.9.0)(discord.js@14.11.0)(youtube-sr@4.3.4): resolution: {integrity: sha512-lW5IcGLycJK6mNtpz5/QqKuhhpBVm475xlsVKEUhoS1CFNcLqob5nAlEXurKjlIhxR+fFglSZ8jmtdFjR8p50g==} peerDependencies: @@ -1202,27 +996,10 @@ packages: domhandler: 5.0.3 dev: false - /ee-first@1.1.1: - resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - dev: false - - /ejs@3.1.9: - resolution: {integrity: sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==} - engines: {node: '>=0.10.0'} - hasBin: true - dependencies: - jake: 10.8.7 - dev: false - /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} dev: false - /encodeurl@1.0.2: - resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} - engines: {node: '>= 0.8'} - dev: false - /encoding@0.1.13: resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==} requiresBuild: true @@ -1237,31 +1014,6 @@ packages: once: 1.4.0 dev: false - /engine.io-parser@5.1.0: - resolution: {integrity: sha512-enySgNiK5tyZFynt3z7iqBR+Bto9EVVVvDFuTT0ioHCGbzirZVGDGiQjZzEp8hWl6hd5FSVytJGuScX1C1C35w==} - engines: {node: '>=10.0.0'} - dev: false - - /engine.io@6.5.1: - resolution: {integrity: sha512-mGqhI+D7YxS9KJMppR6Iuo37Ed3abhU8NdfgSvJSDUafQutrN+sPTncJYTyM9+tkhSmWodKtVYGPPHyXJEwEQA==} - engines: {node: '>=10.0.0'} - dependencies: - '@types/cookie': 0.4.1 - '@types/cors': 2.8.13 - '@types/node': 20.3.3 - accepts: 1.3.8 - base64id: 2.0.0 - cookie: 0.4.2 - cors: 2.8.5 - debug: 4.3.4 - engine.io-parser: 5.1.0 - ws: 8.11.0 - transitivePeerDependencies: - - bufferutil - - supports-color - - utf-8-validate - dev: false - /entities@4.5.0: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} @@ -1278,10 +1030,6 @@ packages: dev: false optional: true - /escape-html@1.0.3: - resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} - dev: false - /escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} @@ -1396,11 +1144,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /etag@1.8.1: - resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} - engines: {node: '>= 0.6'} - dev: false - /event-to-promise@0.7.0: resolution: {integrity: sha512-VOBBfyaADfe378ZzG0tgkzmsvzUyeU5arehrFzNRt5yaASUDshgctTwSrPI17ocAwR3+YftsxRClHF+GBKFByQ==} deprecated: Use promise-toolbox/fromEvent instead @@ -1411,74 +1154,6 @@ packages: engines: {node: '>=6'} dev: false - /express-partials@0.3.0: - resolution: {integrity: sha512-LodvQHqUhSKJNl7NMjjPvHAh7sybtmUOWKKGrrb2/eL/kPlto2KQO5lCVceOBamxipDoWw07zLwWiDwidHgmEQ==} - dev: false - - /express-rate-limit@6.7.0(express@4.18.2): - resolution: {integrity: sha512-vhwIdRoqcYB/72TK3tRZI+0ttS8Ytrk24GfmsxDXK9o9IhHNO5bXRiXQSExPQ4GbaE5tvIS7j1SGrxsuWs+sGA==} - engines: {node: '>= 12.9.0'} - peerDependencies: - express: ^4 || ^5 - dependencies: - express: 4.18.2 - dev: false - - /express-session@1.17.3: - resolution: {integrity: sha512-4+otWXlShYlG1Ma+2Jnn+xgKUZTMJ5QD3YvfilX3AcocOAbIkVylSWEklzALe/+Pu4qV6TYBj5GwOBFfdKqLBw==} - engines: {node: '>= 0.8.0'} - dependencies: - cookie: 0.4.2 - cookie-signature: 1.0.6 - debug: 2.6.9 - depd: 2.0.0 - on-headers: 1.0.2 - parseurl: 1.3.3 - safe-buffer: 5.2.1 - uid-safe: 2.1.5 - transitivePeerDependencies: - - supports-color - dev: false - - /express@4.18.2: - resolution: {integrity: sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==} - engines: {node: '>= 0.10.0'} - dependencies: - accepts: 1.3.8 - array-flatten: 1.1.1 - body-parser: 1.20.1 - content-disposition: 0.5.4 - content-type: 1.0.5 - cookie: 0.5.0 - cookie-signature: 1.0.6 - debug: 2.6.9 - depd: 2.0.0 - encodeurl: 1.0.2 - escape-html: 1.0.3 - etag: 1.8.1 - finalhandler: 1.2.0 - fresh: 0.5.2 - http-errors: 2.0.0 - merge-descriptors: 1.0.1 - methods: 1.1.2 - on-finished: 2.4.1 - parseurl: 1.3.3 - path-to-regexp: 0.1.7 - proxy-addr: 2.0.7 - qs: 6.11.0 - range-parser: 1.2.1 - safe-buffer: 5.2.1 - send: 0.18.0 - serve-static: 1.15.0 - setprototypeof: 1.2.0 - statuses: 2.0.1 - type-is: 1.6.18 - utils-merge: 1.0.1 - vary: 1.1.2 - transitivePeerDependencies: - - supports-color - dev: false - /fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} @@ -1536,12 +1211,6 @@ packages: resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} dev: false - /filelist@1.0.4: - resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==} - dependencies: - minimatch: 5.1.6 - dev: false - /fill-range@7.0.1: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} engines: {node: '>=8'} @@ -1549,21 +1218,6 @@ packages: to-regex-range: 5.0.1 dev: true - /finalhandler@1.2.0: - resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} - engines: {node: '>= 0.8'} - dependencies: - debug: 2.6.9 - encodeurl: 1.0.2 - escape-html: 1.0.3 - on-finished: 2.4.1 - parseurl: 1.3.3 - statuses: 2.0.1 - unpipe: 1.0.0 - transitivePeerDependencies: - - supports-color - dev: false - /find-up@5.0.0: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} @@ -1599,16 +1253,6 @@ packages: engines: {node: '>= 14.17'} dev: false - /forwarded@0.2.0: - resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} - engines: {node: '>= 0.6'} - dev: false - - /fresh@0.5.2: - resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} - engines: {node: '>= 0.6'} - dev: false - /fs-constants@1.0.0: resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} dev: false @@ -1623,10 +1267,6 @@ packages: /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - /function-bind@1.1.1: - resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} - dev: false - /functional-red-black-tree@1.0.1: resolution: {integrity: sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==} dev: true @@ -1696,15 +1336,6 @@ packages: undici: 5.22.1 dev: false - /get-intrinsic@1.2.1: - resolution: {integrity: sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==} - dependencies: - function-bind: 1.1.1 - has: 1.0.3 - has-proto: 1.0.1 - has-symbols: 1.0.3 - dev: false - /get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} @@ -1791,27 +1422,10 @@ packages: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} - /has-proto@1.0.1: - resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==} - engines: {node: '>= 0.4'} - dev: false - - /has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - dev: false - /has-unicode@2.0.1: resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} dev: false - /has@1.0.3: - resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} - engines: {node: '>= 0.4.0'} - dependencies: - function-bind: 1.1.1 - dev: false - /he@1.2.0: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} hasBin: true @@ -1834,17 +1448,6 @@ packages: resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} dev: false - /http-errors@2.0.0: - resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} - engines: {node: '>= 0.8'} - dependencies: - depd: 2.0.0 - inherits: 2.0.4 - setprototypeof: 1.2.0 - statuses: 2.0.1 - toidentifier: 1.0.1 - dev: false - /http-proxy-agent@4.0.1: resolution: {integrity: sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==} engines: {node: '>= 6'} @@ -1875,10 +1478,6 @@ packages: - supports-color dev: false - /https@1.0.0: - resolution: {integrity: sha512-4EC57ddXrkaF0x83Oj8sM6SLQHAWXw90Skqu2M4AEWENZ3F02dFJE/GARA8igO79tcgYqGrD7ae4f5L3um2lgg==} - dev: false - /humanize-ms@1.2.1: resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} dependencies: @@ -1896,13 +1495,6 @@ packages: '@babel/runtime': 7.22.5 dev: false - /iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - dependencies: - safer-buffer: 2.1.2 - dev: false - /iconv-lite@0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} @@ -1960,11 +1552,6 @@ packages: dev: false optional: true - /ipaddr.js@1.9.1: - resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} - engines: {node: '>= 0.10'} - dev: false - /is-buffer@1.1.6: resolution: {integrity: sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==} dev: false @@ -2007,17 +1594,6 @@ packages: /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - /jake@10.8.7: - resolution: {integrity: sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==} - engines: {node: '>=10'} - hasBin: true - dependencies: - async: 3.2.4 - chalk: 4.1.2 - filelist: 1.0.4 - minimatch: 3.1.2 - dev: false - /js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true @@ -2145,30 +1721,16 @@ packages: is-buffer: 1.1.6 dev: false - /media-typer@0.3.0: - resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} - engines: {node: '>= 0.6'} - dev: false - /memory-pager@1.5.0: resolution: {integrity: sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==} dev: false optional: true - /merge-descriptors@1.0.1: - resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} - dev: false - /merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} dev: true - /methods@1.1.2: - resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} - engines: {node: '>= 0.6'} - dev: false - /micromatch@4.0.5: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} engines: {node: '>=8.6'} @@ -2177,24 +1739,6 @@ packages: picomatch: 2.3.1 dev: true - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: false - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: false - - /mime@1.6.0: - resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} - engines: {node: '>=4'} - hasBin: true - dev: false - /mimic-response@2.1.0: resolution: {integrity: sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==} engines: {node: '>=8'} @@ -2215,13 +1759,6 @@ packages: dependencies: brace-expansion: 1.1.11 - /minimatch@5.1.6: - resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} - engines: {node: '>=10'} - dependencies: - brace-expansion: 2.0.1 - dev: false - /minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} dev: false @@ -2422,6 +1959,7 @@ packages: resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} engines: {node: '>= 0.6'} dev: false + optional: true /node-abi@3.45.0: resolution: {integrity: sha512-iwXuFrMAcFVi/ZoZiqq8BzAdsLw9kxDfTC0HMyjXfSL/6CSDAGD5UmR7azrAgWV1zKYq7dUUMj4owusBWKLsiQ==} @@ -2543,22 +2081,6 @@ packages: engines: {node: '>=0.10.0'} dev: false - /object-inspect@1.12.3: - resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} - dev: false - - /on-finished@2.4.1: - resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} - engines: {node: '>= 0.8'} - dependencies: - ee-first: 1.1.1 - dev: false - - /on-headers@1.0.2: - resolution: {integrity: sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==} - engines: {node: '>= 0.8'} - dev: false - /once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} dependencies: @@ -2635,11 +2157,6 @@ packages: entities: 4.5.0 dev: false - /parseurl@1.3.3: - resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} - engines: {node: '>= 0.8'} - dev: false - /path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -2654,10 +2171,6 @@ packages: engines: {node: '>=8'} dev: true - /path-to-regexp@0.1.7: - resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} - dev: false - /path-type@4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} @@ -2761,14 +2274,6 @@ packages: dev: false optional: true - /proxy-addr@2.0.7: - resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} - engines: {node: '>= 0.10'} - dependencies: - forwarded: 0.2.0 - ipaddr.js: 1.9.1 - dev: false - /pump@3.0.0: resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} dependencies: @@ -2780,13 +2285,6 @@ packages: resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} engines: {node: '>=6'} - /qs@6.11.0: - resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} - engines: {node: '>=0.6'} - dependencies: - side-channel: 1.0.4 - dev: false - /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} dev: true @@ -2803,42 +2301,12 @@ packages: lodash: 4.17.21 dev: false - /random-bytes@1.0.0: - resolution: {integrity: sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ==} - engines: {node: '>= 0.8'} - dev: false - /randombytes@2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} dependencies: safe-buffer: 5.2.1 dev: false - /range-parser@1.2.1: - resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} - engines: {node: '>= 0.6'} - dev: false - - /raw-body@2.5.1: - resolution: {integrity: sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==} - engines: {node: '>= 0.8'} - dependencies: - bytes: 3.1.2 - http-errors: 2.0.0 - iconv-lite: 0.4.24 - unpipe: 1.0.0 - dev: false - - /raw-body@2.5.2: - resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==} - engines: {node: '>= 0.8'} - dependencies: - bytes: 3.1.2 - http-errors: 2.0.0 - iconv-lite: 0.4.24 - unpipe: 1.0.0 - dev: false - /rc@1.2.8: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true @@ -2886,11 +2354,6 @@ packages: readable-stream: 3.6.2 dev: false - /readline-sync@1.4.10: - resolution: {integrity: sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==} - engines: {node: '>= 0.8.0'} - dev: false - /regenerator-runtime@0.13.11: resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==} dev: false @@ -2994,53 +2457,16 @@ packages: lru-cache: 6.0.0 dev: false - /send@0.18.0: - resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} - engines: {node: '>= 0.8.0'} - dependencies: - debug: 2.6.9 - depd: 2.0.0 - destroy: 1.2.0 - encodeurl: 1.0.2 - escape-html: 1.0.3 - etag: 1.8.1 - fresh: 0.5.2 - http-errors: 2.0.0 - mime: 1.6.0 - ms: 2.1.3 - on-finished: 2.4.1 - range-parser: 1.2.1 - statuses: 2.0.1 - transitivePeerDependencies: - - supports-color - dev: false - /serialize-javascript@6.0.1: resolution: {integrity: sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==} dependencies: randombytes: 2.1.0 dev: false - /serve-static@1.15.0: - resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==} - engines: {node: '>= 0.8.0'} - dependencies: - encodeurl: 1.0.2 - escape-html: 1.0.3 - parseurl: 1.3.3 - send: 0.18.0 - transitivePeerDependencies: - - supports-color - dev: false - /set-blocking@2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} dev: false - /setprototypeof@1.2.0: - resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} - dev: false - /shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} @@ -3053,14 +2479,6 @@ packages: engines: {node: '>=8'} dev: true - /side-channel@1.0.4: - resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} - dependencies: - call-bind: 1.0.2 - get-intrinsic: 1.2.1 - object-inspect: 1.12.3 - dev: false - /sift@13.5.2: resolution: {integrity: sha512-+gxdEOMA2J+AI+fVsCqeNn7Tgx3M9ZN9jdi95939l1IJ8cZsqS8sqpJyOkic2SJk+1+98Uwryt/gL6XDaV+UZA==} dev: false @@ -3104,42 +2522,6 @@ packages: dev: false optional: true - /socket.io-adapter@2.5.2: - resolution: {integrity: sha512-87C3LO/NOMc+eMcpcxUBebGjkpMDkNBS9tf7KJqcDsmL936EChtVva71Dw2q4tQcuVC+hAUy4an2NO/sYXmwRA==} - dependencies: - ws: 8.11.0 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - dev: false - - /socket.io-parser@4.2.4: - resolution: {integrity: sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==} - engines: {node: '>=10.0.0'} - dependencies: - '@socket.io/component-emitter': 3.1.0 - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - dev: false - - /socket.io@4.7.1: - resolution: {integrity: sha512-W+utHys2w//dhFjy7iQQu9sGd3eokCjGbl2r59tyLqNiJJBdIebn3GAKEXBr3osqHTObJi2die/25bCx2zsaaw==} - engines: {node: '>=10.0.0'} - dependencies: - accepts: 1.3.8 - base64id: 2.0.0 - cors: 2.8.5 - debug: 4.3.4 - engine.io: 6.5.1 - socket.io-adapter: 2.5.2 - socket.io-parser: 4.2.4 - transitivePeerDependencies: - - bufferutil - - supports-color - - utf-8-validate - dev: false - /socks-proxy-agent@6.2.1: resolution: {integrity: sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==} engines: {node: '>= 10'} @@ -3213,11 +2595,6 @@ packages: dev: false optional: true - /statuses@2.0.1: - resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} - engines: {node: '>= 0.8'} - dev: false - /streamsearch@1.1.0: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} engines: {node: '>=10.0.0'} @@ -3336,11 +2713,6 @@ packages: is-number: 7.0.0 dev: true - /toidentifier@1.0.1: - resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} - engines: {node: '>=0.6'} - dev: false - /token-types@4.2.1: resolution: {integrity: sha512-6udB24Q737UD/SDsKAHI9FCRP7Bqc9D/MQUV02ORQg5iskjtLJlZJNdN4kKtcdtwCeWIwIHDGaUsTsCCAa8sFQ==} engines: {node: '>=10'} @@ -3387,21 +2759,6 @@ packages: engines: {node: '>=10'} dev: true - /type-is@1.6.18: - resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} - engines: {node: '>= 0.6'} - dependencies: - media-typer: 0.3.0 - mime-types: 2.1.35 - dev: false - - /uid-safe@2.1.5: - resolution: {integrity: sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==} - engines: {node: '>= 0.8'} - dependencies: - random-bytes: 1.0.0 - dev: false - /undici@5.22.1: resolution: {integrity: sha512-Ji2IJhFXZY0x/0tVBXeQwgPlLWw13GVzpsWPQ3rV50IFMMof2I55PZZxtm4P6iNq+L5znYN9nSTAq0ZyE6lSJw==} engines: {node: '>=14.0'} @@ -3423,11 +2780,6 @@ packages: dev: false optional: true - /unpipe@1.0.0: - resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} - engines: {node: '>= 0.8'} - dev: false - /uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: @@ -3438,25 +2790,10 @@ packages: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} dev: false - /utils-merge@1.0.1: - resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} - engines: {node: '>= 0.4.0'} - dev: false - - /uuid@8.3.2: - resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} - hasBin: true - dev: false - /varint@6.0.0: resolution: {integrity: sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==} dev: false - /vary@1.1.2: - resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} - engines: {node: '>= 0.8'} - dev: false - /webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} dev: false @@ -3484,19 +2821,6 @@ packages: /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - /ws@8.11.0: - resolution: {integrity: sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - dev: false - /ws@8.13.0: resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==} engines: {node: '>=10.0.0'}