Skip to content

Commit a025196

Browse files
committed
fix: handle deferred interactions in slash command return values
1 parent 5ea9bac commit a025196

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/runtime/server/utils/client.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,12 @@ export class DiscordClient {
243243

244244
try {
245245
if (typeof result === 'string') {
246-
return interaction.reply({ content: result })
246+
if (interaction.deferred) {
247+
return interaction.editReply({ content: result })
248+
}
249+
else {
250+
return interaction.reply({ content: result })
251+
}
247252
}
248253
else if (typeof result === 'function') {
249254
const newResult = result.call(this, interaction, this)

0 commit comments

Comments
 (0)