From 6de0be72d542685ae3645c1cd6257dd86cc1c302 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Sun, 28 May 2023 20:21:40 +1000 Subject: [PATCH] Place a temporary placeholder on moderating a member that isn't in a server. --- src/client.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client.ts b/src/client.ts index 2e5fe7c..db4bf70 100644 --- a/src/client.ts +++ b/src/client.ts @@ -176,9 +176,9 @@ export default class TClient extends Client { const User = interaction.options.getUser('member', true); console.log(this.logTime(), `[PunishmentLog] ${GuildMember?.user?.tag ?? User?.tag ?? 'No user data'} ${time ? ['warn', 'kick'].includes(this.punishments.type) ? 'and no duration set' : `and ${time} (duration)` : ''} was used in /${interaction.commandName} for ${reason}`); - (this.channels.cache.get(this.config.mainServer.channels.punishment_log) as Discord.TextChannel).send({embeds:[new this.embed().setColor(this.config.embedColor).setTitle('Punishment Log').setDescription(`${GuildMember.user.tag ?? User.tag ?? 'No user data'} ${time ? ['warn', 'kick'].includes(this.punishments.type) ? 'and no duration set' : `and ${time} (duration)` : ''} was used in \`/${interaction.commandName}\` for \`${reason}\``).setTimestamp()]}); - if (interaction.user.id == User.id) return interaction.reply(`You cannot ${type} yourself.`); - if (!GuildMember && type != 'ban') return interaction.reply(`You cannot ${type} someone who is not in the server.`); + (this.channels.cache.get(this.config.mainServer.channels.punishment_log) as Discord.TextChannel).send({embeds:[new this.embed().setColor(this.config.embedColor).setTitle('Punishment Log').setDescription(`${GuildMember?.user?.tag ?? User?.tag ?? 'No user data'} ${time ? ['warn', 'kick'].includes(this.punishments.type) ? 'and no duration set' : `and ${time} (duration)` : ''} was used in \`/${interaction.commandName}\` for \`${reason}\``).setTimestamp()]}); + if (interaction.user.id === User.id) return interaction.reply(`You cannot ${type} yourself.`); + if (!GuildMember && type != 'unban') return interaction.reply(`You cannot ${type} someone who is not in the server.`); if (User.bot) return interaction.reply(`You cannot ${type} a bot!`); await interaction.deferReply();