From a77ee0f3d4f78c51adf944613abe4b43fdecd0d2 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Sun, 24 Jul 2022 16:49:09 +0300 Subject: [PATCH] fixes --- .../en_gb/commands/en_gb_administration.lang | 9 +++++++++ src/localization/en_gb/commands/en_gb_moderation.lang | 3 +++ src/structure/DiscordClient.js | 4 ++-- .../components/commands/administration/Import.js | 11 +++++++++-- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/localization/en_gb/commands/en_gb_administration.lang b/src/localization/en_gb/commands/en_gb_administration.lang index 13d772e..3a52bc4 100644 --- a/src/localization/en_gb/commands/en_gb_administration.lang +++ b/src/localization/en_gb/commands/en_gb_administration.lang @@ -54,6 +54,15 @@ Configure bot settings for the server. [COMMAND_MODERATION_HELP] Configure moderation related settings. +[COMMAND_LOGGING_HELP] +Configure logging settings. + +[COMMAND_UTILITY_HELP] +Configure utility settings. + +[COMMAND_ADMINISTRATION_HELP] +Configure administrative settings. + // Import [COMMAND_IMPORT_HELP] Import configuration and data from old versions of the bot. diff --git a/src/localization/en_gb/commands/en_gb_moderation.lang b/src/localization/en_gb/commands/en_gb_moderation.lang index 4f1d911..4c6836a 100644 --- a/src/localization/en_gb/commands/en_gb_moderation.lang +++ b/src/localization/en_gb/commands/en_gb_moderation.lang @@ -441,6 +441,9 @@ No changes have been made to the case. **Length:** {time} ({inSeconds} seconds) // Edit command +[COMMAND_EDIT_HELP] +Edit case data, such as reason, duration, points and expiration. + [COMMAND_EDIT_LONG] Please respond with the new reason. Timeout in {time} seconds diff --git a/src/structure/DiscordClient.js b/src/structure/DiscordClient.js index e59a8c1..b34c9b6 100644 --- a/src/structure/DiscordClient.js +++ b/src/structure/DiscordClient.js @@ -208,7 +208,7 @@ class DiscordClient extends Client { async _setActivity() { const activities = { - 0: async () => { + 2: async () => { const result = await this.shard.broadcastEval((client) => client.guilds.cache.size).catch(() => null); if (!result) return; const guildCount = result.reduce((p, v) => p+v, 0); @@ -220,7 +220,7 @@ class DiscordClient extends Client { const userCount = result.reduce((p, v) => p+v, 0); this.user.setActivity(`${userCount} users`, { type: ActivityType.Listening }); }, - 2: async () => { + 0: async () => { this.user.setActivity("for /help", { type: ActivityType.Listening }); } }; diff --git a/src/structure/components/commands/administration/Import.js b/src/structure/components/commands/administration/Import.js index fb36b81..a657e9f 100644 --- a/src/structure/components/commands/administration/Import.js +++ b/src/structure/components/commands/administration/Import.js @@ -41,7 +41,8 @@ class ImportCommand extends SlashCommand { description: 'Whether any existing logs should be overwritten by the imports. By default new ones are bumped', type: 'BOOLEAN' }] - }] + }], + clientPermissions: ['ManageWebhooks'] }); } @@ -139,7 +140,13 @@ class ImportCommand extends SlashCommand { if (typeof webhook === 'string') { const hooks = await guild.fetchWebhooks(); const hook = hooks.get(webhook); - if (hook) await guild.updateWebhook('messages', hook); + if (hook) { + const channel = await guild.resolveChannel(hook.channelId); + await hook.delete(); + + const newHook = await channel.createWebhook({ name: 'Galactic Bot message logs' }); + await guild.updateWebhook('messages', newHook); + } } else if (version === '3') { delete webhook.feature; await this.client.storageManager.mongodb.webhooks.updateOne({ feature: 'messages', guild: guild.id }, webhook);