Skip to content

Commit

Permalink
fix: defer reply in Browse command execution
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-737 committed May 22, 2024
1 parent 852c02b commit 4909bb5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/commands/slash/Main/hub/browse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import { connectChannel } from '../../../../utils/ConnectedList.js';

export default class Browse extends Hub {
async execute(interaction: ChatInputCommandInteraction<CacheType>): Promise<void> {
await interaction.deferReply();

const sortBy = interaction.options.getString('sort') as
| 'servers'
| 'active'
Expand Down Expand Up @@ -104,12 +106,11 @@ export default class Browse extends Hub {
);

if (!hubList || hubList.length === 0) {
await interaction.reply({
await interaction.editReply({
content: t(
{ phrase: 'hub.browse.noHubs', locale: interaction.user.locale },
{ emoji: emojis.no },
),
ephemeral: true,
});
return;
}
Expand Down

0 comments on commit 4909bb5

Please sign in to comment.