1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 04:10:59 -05:00

Display limit for reason option in Punish.ts

This commit is contained in:
toast-ts 2024-01-24 07:24:09 +11:00
parent 14df879b6e
commit 05f9d1d18c

View File

@ -10,6 +10,7 @@ export default async(client:TClient, interaction: Discord.ChatInputCommandIntera
const reason = interaction.options.getString('reason') ?? 'Reason unspecified'; const reason = interaction.options.getString('reason') ?? 'Reason unspecified';
const GuildMember = interaction.options.getMember('member') ?? undefined; const GuildMember = interaction.options.getMember('member') ?? undefined;
const User = interaction.options.getUser('member', true); const User = interaction.options.getUser('member', true);
if (reason.length > 1020) return interaction.reply({content: 'Reason cannot be longer than 1020 characters due to Discord\'s limit.', ephemeral: true});
const punishLog = `${GuildMember?.user?.username ?? User?.username ?? 'No user data'} ${time ? ['warn', 'kick'].includes(type) ? 'and no duration set' : `and ${time} (duration)` : ''} was used in \`/${interaction.commandName}\` for \`${reason}\``; const punishLog = `${GuildMember?.user?.username ?? User?.username ?? 'No user data'} ${time ? ['warn', 'kick'].includes(type) ? 'and no duration set' : `and ${time} (duration)` : ''} was used in \`/${interaction.commandName}\` for \`${reason}\``;
Logger.console('log', 'PunishmentLog', punishLog); Logger.console('log', 'PunishmentLog', punishLog);