From fd2796865c892d4763f24a5929df30e6bba9e5b3 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Sat, 17 Jun 2023 00:44:47 +0500 Subject: [PATCH] fallbacks for welcome and goodbye --- commands/Administration/goodbye.js | 4 ++-- commands/Administration/welcome.js | 4 ++-- events/MessageHandler.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/commands/Administration/goodbye.js b/commands/Administration/goodbye.js index 52d2fcdf..27aed65e 100644 --- a/commands/Administration/goodbye.js +++ b/commands/Administration/goodbye.js @@ -96,9 +96,9 @@ class Goodbye extends BaseCommand { interaction.success("administration/goodbye:DISABLED"); } else { - const channel = interaction.options.getChannel("channel"); + const channel = interaction.options.getChannel("channel") || interaction.channel; const message = interaction.options.getString("message") || interaction.translate("administration/goodbye:DEFAULT_MESSAGE"); - const image = interaction.options.getBoolean("image"); + const image = interaction.options.getBoolean("image") || true; data.guildData.plugins.goodbye = { enabled: true, diff --git a/commands/Administration/welcome.js b/commands/Administration/welcome.js index 778b3d54..e63d3f1a 100644 --- a/commands/Administration/welcome.js +++ b/commands/Administration/welcome.js @@ -96,9 +96,9 @@ class Welcome extends BaseCommand { interaction.success("administration/welcome:DISABLED"); } else { - const channel = interaction.options.getChannel("channel"); + const channel = interaction.options.getChannel("channel") || interaction.channel; const message = interaction.options.getString("message") || interaction.translate("administration/welcome:DEFAULT_MESSAGE"); - const image = interaction.options.getBoolean("image"); + const image = interaction.options.getBoolean("image") || true; data.guildData.plugins.welcome = { enabled: true, diff --git a/events/MessageHandler.js b/events/MessageHandler.js index 78170e55..52f9ec9d 100644 --- a/events/MessageHandler.js +++ b/events/MessageHandler.js @@ -106,8 +106,8 @@ class MessageCreate extends BaseEvent { 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)) { - message.delete(); message.error("administration/automod:DELETED"); + message.delete(); } const afkReason = data.userData.afk;