discord-api-docs icon indicating copy to clipboard operation
discord-api-docs copied to clipboard

sending a followup after deferring a slash command ignores the SUPPRESS_EMBEDS flag

Open sebm253 opened this issue 2 years ago • 5 comments

Description

When you defer a slash command and then send a followup, the SUPPRESS_EMBEDS flag is ignored for the followup message, resulting in embeds still being rendered.

Steps to Reproduce

  1. respond to a slash command with type 5 (DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE)
  2. send a followup message (POST /webhooks/{application.id}/{interaction.token}) with a link in the content and flags: 4
  3. observe

Expected Behavior

The embeds should not be rendered.

Current Behavior

The SUPPRESS_EMBEDS flag is being ignored, resulting in embeds being rendered.

Screenshots/Videos

No response

Client and System Information

Canary 124017 (2c2001f) Host 1.0.45 Windows 10 64-Bit (10.0.19044)

sebm253 avatar Apr 14 '22 12:04 sebm253

From the docs:

flags can be set to 64 to mark the message as ephemeral, except when it is the first followup message to a deferred Interactions Response. In that case, the flags field will be ignored, and the ephemerality of the message will be determined by the flags value in your original ACK.

Basically, you have to set flags when you're deferring the response, as it will be ignored in the first followup message. This is not a bug.

TobiasSN avatar Apr 14 '22 13:04 TobiasSN

From the docs:

flags can be set to 64 to mark the message as ephemeral, except when it is the first followup message to a deferred Interactions Response. In that case, the flags field will be ignored, and the ephemerality of the message will be determined by the flags value in your original ACK.

Basically, you have to set flags when you're deferring the response, as it will be ignored in the first followup message. This is not a bug.

even with flags: 68 it renders the embeds. it's probably an oversight in the api.

sebm253 avatar Apr 14 '22 17:04 sebm253

I didn't say to make the response ephemeral. What I was referring to is that when you defer an interaction response, the flags field in the first followup message will be ignored, and you should set it on the original deferral instead. It's documented behavior.

TobiasSN avatar Apr 14 '22 17:04 TobiasSN

I didn't say to make the response ephemeral. What I was referring to is that when you defer an interaction response, the flags field in the first followup message will be ignored, and you should set it on the original deferral instead. It's documented behavior.

yes, that's what I did. try it yourself. the followup had no flags at all, while the interaction callback had both flags.

sebm253 avatar Apr 14 '22 17:04 sebm253

Can reproduce.

POST https://discord.com/api/v10/interactions/:id/:token/callback with {"type":5,"data":{"flags":4}} has returned status code 204

PATCH https://discord.com/api/v10/webhooks/:id/:token/messages/@original has returned.... {"flags":0}

using disnake 2.5.0a

onerandomusername avatar Apr 25 '22 06:04 onerandomusername

I think this is fixed now.

devsnek avatar Oct 28 '22 17:10 devsnek