fallbacks for welcome and goodbye

This commit is contained in:
Jonny_Bro (Nikita) 2023-06-17 00:44:47 +05:00
parent abb8da6127
commit fd2796865c
3 changed files with 5 additions and 5 deletions

View file

@ -96,9 +96,9 @@ class Goodbye extends BaseCommand {
interaction.success("administration/goodbye:DISABLED"); interaction.success("administration/goodbye:DISABLED");
} else { } 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 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 = { data.guildData.plugins.goodbye = {
enabled: true, enabled: true,

View file

@ -96,9 +96,9 @@ class Welcome extends BaseCommand {
interaction.success("administration/welcome:DISABLED"); interaction.success("administration/welcome:DISABLED");
} else { } 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 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 = { data.guildData.plugins.welcome = {
enabled: true, enabled: true,

View file

@ -106,8 +106,8 @@ class MessageCreate extends BaseEvent {
if (data.guildData.plugins.automod.enabled && !data.guildData.plugins.automod.ignored.includes(message.channel.id)) 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 (/(discord\.(gg|io|me|li)\/.+|discordapp\.com\/invite\/.+)/i.test(message.content))
if (!message.channel.permissionsFor(message.member).has(PermissionsBitField.Flags.ManageMessages)) { if (!message.channel.permissionsFor(message.member).has(PermissionsBitField.Flags.ManageMessages)) {
message.delete();
message.error("administration/automod:DELETED"); message.error("administration/automod:DELETED");
message.delete();
} }
const afkReason = data.userData.afk; const afkReason = data.userData.afk;