Skip to content

Commit

Permalink
fix(moderate): label failing to set on long names
Browse files Browse the repository at this point in the history
  • Loading branch information
theimperious1 committed Aug 5, 2024
1 parent 307b331 commit 80620c7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/discord/commands/guild/d.moderate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1864,7 +1864,11 @@ export async function modModal(
.setCustomId('internalNote');

try {
modalInputComponent.setLabel(`Why are you ${verb} ${target}?`);
// Ensure the label text is within the limit
const label = `Why are you ${verb} ${target}?`;
const truncatedLabelText = label.length > 45 ? `${label.substring(0, 41)}...?` : label;

modalInputComponent.setLabel(truncatedLabelText);
} catch (err) {
log.error(F, `Error: ${err}`);
log.error(F, `Verb: ${verb}, Target: ${target}`);
Expand Down

0 comments on commit 80620c7

Please sign in to comment.