Skip to content

Commit

Permalink
fix(techHelp): switched to discord min/max length functions, removed …
Browse files Browse the repository at this point in the history
…warning
  • Loading branch information
theimperious1 committed Jul 1, 2024
1 parent 5f446e2 commit dfcd5f3
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/discord/utils/techHelp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ export async function techHelpClick(interaction:ButtonInteraction) {
.setCustomId(`techHelpSubmit~${interaction.id}`)
.setTitle(`${interaction.guild.name} Feedback`)
.addComponents(new ActionRowBuilder<TextInputBuilder>().addComponents(new TextInputBuilder()
.setLabel('What is your issue? Be super detailed! (2000 character limit)')
.setLabel('What is your issue? Be super detailed!')
.setStyle(TextInputStyle.Paragraph)
.setPlaceholder(placeholder)
.setCustomId(`${issueType}IssueInput`)
.setRequired(true))));
.setRequired(true)
.setMinLength(10)
.setMaxLength(2000))));

const filter = (i:ModalSubmitInteraction) => i.customId.includes('techHelpSubmit');
interaction.awaitModalSubmit({ filter, time: 0 })
Expand All @@ -94,14 +96,6 @@ export async function techHelpClick(interaction:ButtonInteraction) {
const modalInput = i.fields.getTextInputValue(`${issueType}IssueInput`);
// log.debug(F, `modalInput: ${modalInput}!`);

if (modalInput.length > 2000) {
await interaction.reply({
content: 'Your feedback must be 2000 characters or less!',
ephemeral: true,
});
return;
}

// // Get the actor
const actor = i.user;

Expand Down

0 comments on commit dfcd5f3

Please sign in to comment.