fix(bot): don't override flags when isPrivate (#4191)

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
This commit is contained in:
Fleny
2025-05-10 21:21:00 +02:00
committed by GitHub
co-authored by Awesome Stickz
parent 83d329c374
commit 059c6a9797
+4 -1
View File
@@ -39,7 +39,10 @@ export const baseInteraction: InternalBot['transformers']['$inferredTypes']['int
// If user provides an object, determine if it should be an autocomplete or a modal response
if (response.title) type = InteractionResponseTypes.Modal
if (this.type === InteractionTypes.ApplicationCommandAutocomplete) type = InteractionResponseTypes.ApplicationCommandAutocompleteResult
if (type === InteractionResponseTypes.ChannelMessageWithSource && options?.isPrivate) response.flags = MessageFlags.Ephemeral
if (type === InteractionResponseTypes.ChannelMessageWithSource && options?.isPrivate) {
response.flags ??= 0
response.flags |= MessageFlags.Ephemeral
}
// Since this has already been given a response, any further responses must be followups.
if (this.acknowledged) return await this.bot.helpers.sendFollowupMessage(this.token, response)