Skip to content

Commit

Permalink
fix(DeferReply): defer reply for other types of commands as well
Browse files Browse the repository at this point in the history
  • Loading branch information
CarelessInternet committed Mar 3, 2024
1 parent 64f93d4 commit 70f4d08
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/djs-framework/src/decorators/DeferReply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ export function DeferReply({ name, ephemeral = false }: DeferReplyOptions = {})
const original = descriptor.value as () => void;

descriptor.value = async function (this: Command.Interaction, { interaction }: Command.Context) {
if (interaction.isChatInputCommand() && !interaction.replied && !interaction.deferred) {
if (interaction.isRepliable() && !interaction.replied && !interaction.deferred) {
await interaction.deferReply({
ephemeral: interaction.options.getBoolean(String(name), false) ?? ephemeral,
ephemeral: interaction.isChatInputCommand()
? interaction.options.getBoolean(String(name), false) ?? ephemeral
: ephemeral,
});
}

Expand Down

2 comments on commit 70f4d08

@lostofficial
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I caused this issue. W.

@CarelessInternet
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@randomdeveloperdude Congratulations! Now you owe a star to this repository.

Please sign in to comment.