From c232c7b2057d7ebd270e482bbc7743f4cce7c52d Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Wed, 1 Feb 2023 00:23:01 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BA=D0=BE=D0=B1=D0=BE=D1=87=D0=BA?= =?UTF-8?q?=D0=B8=20=3D)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/JaBa.js | 6 +++--- commands/General/staff.js | 8 ++++---- commands/General/userinfo.js | 4 ++-- commands/NSFW/nsfw.js | 2 +- dashboard/routes/guild-manager.js | 6 +++--- dashboard/routes/guild-stats.js | 2 +- dashboard/utils.js | 8 ++++---- dashboard/views/includes/sidebar.ejs | 2 +- dashboard/views/manager/guild.ejs | 6 +++--- dashboard/views/stats/guild.ejs | 2 +- events/Guild/guildMemberAdd.js | 2 +- helpers/autoUpdateDocs.js | 4 ++-- helpers/checkReminds.js | 2 +- scripts/verify-config.js | 10 +++++----- 14 files changed, 32 insertions(+), 32 deletions(-) diff --git a/base/JaBa.js b/base/JaBa.js index 415c42a7..a6264872 100644 --- a/base/JaBa.js +++ b/base/JaBa.js @@ -98,7 +98,7 @@ class JaBa extends Client { useUnifiedTopology: true, }).then(() => { this.logger.log("Connected to the Mongodb database.", "log"); - }).catch((err) => { + }).catch(err => { this.logger.log(`Unable to connect to the Mongodb database. Error: ${err}`, "error"); }); @@ -133,7 +133,7 @@ class JaBa extends Client { this.commands.set(command.command.name, command); const aliases = []; if (command.aliases && Array.isArray(command.aliases) && command.aliases.length > 0) - command.aliases.forEach((alias) => { + command.aliases.forEach(alias => { const command_alias = (command.command instanceof SlashCommandBuilder || command.command instanceof ContextMenuCommandBuilder) ? { ...command.command.toJSON() } : { ...command.command }; command_alias.name = alias; aliases.push(command_alias); @@ -181,7 +181,7 @@ class JaBa extends Client { this.commands.set(command.command.name, command); const aliases = []; if (command.aliases && Array.isArray(command.aliases) && command.aliases.length > 0) - command.aliases.forEach((alias) => { + command.aliases.forEach(alias => { const command_alias = command.command instanceof SlashCommandBuilder ? { ...command.command.toJSON() } : { ...command.command }; command_alias.name = alias; aliases.push(command_alias); diff --git a/commands/General/staff.js b/commands/General/staff.js index 0173ce8c..46d02e34 100644 --- a/commands/General/staff.js +++ b/commands/General/staff.js @@ -32,8 +32,8 @@ class Staff extends BaseCommand { */ async execute(client, interaction) { await interaction.guild.members.fetch(); - const administrators = interaction.guild.members.cache.filter((m) => m.permissions.has(PermissionsBitField.Flags.Administrator) && !m.user.bot); - const moderators = interaction.guild.members.cache.filter((m) => !administrators.has(m.id) && m.permissions.has(PermissionsBitField.Flags.ManageMessages) && !m.user.bot); + const administrators = interaction.guild.members.cache.filter(m => m.permissions.has(PermissionsBitField.Flags.Administrator) && !m.user.bot); + const moderators = interaction.guild.members.cache.filter(m => !administrators.has(m.id) && m.permissions.has(PermissionsBitField.Flags.ManageMessages) && !m.user.bot); const embed = new EmbedBuilder() .setAuthor({ name: interaction.translate("general/staff:TITLE", { @@ -43,11 +43,11 @@ 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) diff --git a/commands/General/userinfo.js b/commands/General/userinfo.js index 4c94aebe..cdd34d2e 100644 --- a/commands/General/userinfo.js +++ b/commands/General/userinfo.js @@ -80,9 +80,9 @@ 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", { + 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(", ")), + }) : (member.roles.cache.size < 1) ? interaction.translate("general/userinfo:NO_ROLE") : member.roles.cache.map(r => r).join(", ")), inline: true, }, ]) diff --git a/commands/NSFW/nsfw.js b/commands/NSFW/nsfw.js index aad6f4b1..1f6922a9 100644 --- a/commands/NSFW/nsfw.js +++ b/commands/NSFW/nsfw.js @@ -34,7 +34,7 @@ class NSFW extends BaseCommand { async execute(client, interaction) { await interaction.deferReply({ ephemeral: true }); - if ((interaction.guildId && !interaction.channel.nsfw)) return interaction.replyT("misc:NSFW_COMMAND", null, { ephemeral: true, edit: true }); + if (interaction.guildId && !interaction.channel.nsfw) return interaction.replyT("misc:NSFW_COMMAND", null, { ephemeral: true, edit: true }); const tags = ["hentai", "ecchi", "lewdanimegirls", "hentaifemdom", "animefeets", "animebooty", "biganimetiddies", "sideoppai", "ahegao"].map(tag => JSON.parse(JSON.stringify({ diff --git a/dashboard/routes/guild-manager.js b/dashboard/routes/guild-manager.js index e86a915d..8fb6d4a9 100644 --- a/dashboard/routes/guild-manager.js +++ b/dashboard/routes/guild-manager.js @@ -7,7 +7,7 @@ const express = require("express"), router.get("/:serverID", CheckAuth, async(req, res) => { // Check if the user has the permissions to edit this guild const guild = req.client.guilds.cache.get(req.params.serverID); - if (!guild || !req.userInfos.displayedGuilds || !req.userInfos.displayedGuilds.find((g) => g.id === req.params.serverID)) + if (!guild || !req.userInfos.displayedGuilds || !req.userInfos.displayedGuilds.find(g => g.id === req.params.serverID)) return res.render("404", { user: req.userInfos, translate: req.translate, @@ -32,7 +32,7 @@ router.get("/:serverID", CheckAuth, async(req, res) => { router.post("/:serverID", CheckAuth, async(req, res) => { // Check if the user has the permissions to edit this guild const guild = req.client.guilds.cache.get(req.params.serverID); - if (!guild || !req.userInfos.displayedGuilds || !req.userInfos.displayedGuilds.find((g) => g.id === req.params.serverID)) + if (!guild || !req.userInfos.displayedGuilds || !req.userInfos.displayedGuilds.find(g => g.id === req.params.serverID)) return res.render("404", { user: req.userInfos, translate: req.translate, @@ -43,7 +43,7 @@ router.post("/:serverID", CheckAuth, async(req, res) => { const data = req.body; if (data.language) { - const language = req.client.languages.find((language) => language.nativeName.toLowerCase() === data.language.toLowerCase()); + const language = req.client.languages.find(language => language.nativeName.toLowerCase() === data.language.toLowerCase()); if (language) guildData.language = language.name; if (data.prefix.length >= 1 && data.prefix.length < 2000) guildData.prefix = data.prefix; diff --git a/dashboard/routes/guild-stats.js b/dashboard/routes/guild-stats.js index 6590d670..f4dcffc6 100644 --- a/dashboard/routes/guild-stats.js +++ b/dashboard/routes/guild-stats.js @@ -19,7 +19,7 @@ router.get("/:serverID", CheckAuth, async (req, res) => { const membersData = await req.client.membersData.find({ guildID: guild.id, }).lean(), - members = membersData.map((m) => { + members = membersData.map(m => { return { id: m.id, money: m.money + m.bankSold, diff --git a/dashboard/utils.js b/dashboard/utils.js index a47241cb..9a4965a0 100644 --- a/dashboard/utils.js +++ b/dashboard/utils.js @@ -9,7 +9,7 @@ const { PermissionsBitField } = require("discord.js"); */ async function fetchUser(userData, client, query) { if (userData.guilds) { - userData.guilds.forEach((guild) => { + userData.guilds.forEach(guild => { if (!client.guilds.cache.get(guild.id)) return; const perms = new PermissionsBitField(BigInt(guild.permissions)); if (perms.has(PermissionsBitField.Flags.ManageGuild)) guild.admin = true; @@ -44,9 +44,9 @@ async function fetchUser(userData, client, query) { * @returns {object} The user informations */ async function fetchUsers(array, client) { - return new Promise((resolve) => { + return new Promise(resolve => { const users = []; - array.filter((e) => e.id).forEach((element) => { + array.filter(e => e.id).forEach(element => { client.users.fetch(element.id).then(user => { if (user.username.length > 15) user.username = user.username.substr(0, 12) + "..."; @@ -80,7 +80,7 @@ async function fetchGuild(guildID, client, guilds) { return { ...guild, ...conf.toJSON(), - ...guilds.find((g) => g.id === guild.id), + ...guilds.find(g => g.id === guild.id), }; } diff --git a/dashboard/views/includes/sidebar.ejs b/dashboard/views/includes/sidebar.ejs index 8ac765ba..7275a1b1 100644 --- a/dashboard/views/includes/sidebar.ejs +++ b/dashboard/views/includes/sidebar.ejs @@ -31,7 +31,7 @@ <% if (user.displayedGuilds) { %>