dispike icon indicating copy to clipboard operation
dispike copied to clipboard

DeferredResponse ignores ActionRow and Empherical

Open EthanC opened this issue 4 years ago • 5 comments

When attempting to send a DeferredResponse, certain components of the new_message DiscordResponse are ignored. In my experience, both action_row and empherical do not function.

Example:

@interactions.on("example")
async def ExampleCommand(ctx: IncomingDiscordInteraction) -> DeferredResponse:
    """Example command demonstrating DeferredResponse ignoring action_row and empherical."""

    await bot.send_deferred_message(
        original_context=ctx,
        new_message=DiscordResponse(
            content="This part works",
            action_row=ActionRow(
                components=[
                    LinkButton(
                        label="This does not work",
                        url="https://github.com/ms7m/dispike",
                    )
                ]
            ),
            empherical=True
        ),
    )

EthanC avatar Aug 02 '21 01:08 EthanC

Same issue with me, but it looks like this a problem on Discord's side. https://github.com/discord/discord-api-docs/issues/2735.. (At least for Empherical).. It might also be the reason why ActionRows don't work..

I'll try to poke around the docs and ask for support if this is the case.

ms7m avatar Aug 02 '21 07:08 ms7m

Took a deeper look at it, it seems that if the original message (DeferredResponse) is not empherical, it cannot be changed to empherical later on (as well as action rows). I think I'll work on a method to let the the user know this is the case.

ms7m avatar Aug 02 '21 22:08 ms7m

Would it be possible to work around this API limitation for action_rows in a DeferredResponse, similar to how you've done with DeferredEmphericalResponse? Perhaps something like DeferredComponentResponse?

EthanC avatar Aug 07 '21 00:08 EthanC

That sounds good, i'll add that.

ms7m avatar Aug 07 '21 05:08 ms7m

@ms7m The API forces a less than ideal implementation for this, but to cover all bases, maybe a DeferredEmphericalComponentResponse should be implemented as well? It's not an attractive name for the class, but from the looks of discussion in the Discord Developers Server, this is an intended behavior that should be supported.

EthanC avatar Aug 09 '21 23:08 EthanC