Skip to content

Commit

Permalink
interaction already replied in faq print-all
Browse files Browse the repository at this point in the history
  • Loading branch information
benw202 committed Jan 28, 2024
1 parent 78d5642 commit 8849ef0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Update <small>_ January 2024</small>

- fix: interaction already replied in faq print-all (28/01/2024)
- fix: command names (28/01/2024)
- fix: ignore Dyno bot (27/01/2024)
- fix: use - instead of _ in command names (27/01/2024)
Expand Down
10 changes: 5 additions & 5 deletions src/commands/moderation/faq/functions/faqPrintAll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export async function handlePrintAllFAQ(interaction: ChatInputCommandInteraction
const faqs = await FAQ.find();

if (faqs.length === 0) {
await interaction.reply('No FAQs found.');
} else if (interaction.channel) {
return interaction.followUp('No FAQs found.');
} if (interaction.channel) {
await interaction.channel.send({ files: [FLIGHT_DECK_IMAGE_URL] });

// Divide the FAQs into sets of 5
Expand All @@ -61,12 +61,12 @@ export async function handlePrintAllFAQ(interaction: ChatInputCommandInteraction

await interaction.channel.send({ embeds: [linksEmbed] });
} else {
await interaction.reply({ content: 'FAQs can only be printed in a text channel.', ephemeral: true });
return interaction.followUp({ content: 'FAQs can only be printed in a text channel.', ephemeral: true });
}
} catch (error) {
Logger.error('Error fetching FAQs:', error);
await interaction.reply('An error occurred while fetching FAQs.');
return interaction.followUp('An error occurred while fetching FAQs.');
}

await interaction.followUp({ content: 'FAQs printed successfully.', ephemeral: true });
return interaction.followUp({ content: 'FAQs printed successfully.', ephemeral: true });
}

0 comments on commit 8849ef0

Please sign in to comment.