ms7m/dispike

DiscordResponse does not validate or throw error upon insufficient response

Closed this issue · 1 comments

Attempting to send a DiscordResponse that does not contain content (or embeds?) but does contain an action_row is not a valid response. However, dispike will not throw an error of any kind when this interaction fails, the only indication that it was not successful is the Discord UI.

Example:

@interactions.on("example")
async def ExampleCommand(ctx: IncomingDiscordInteraction) -> DiscordResponse:
    """Example command demonstrating DiscordResponse quietly failing."""

    return DiscordResponse(
        action_row=ActionRow(
            components=LinkButton(
                label="Example", url="https://github.com/ms7m/dispike"
            )
        )
    )

@ms7m 5b7200f does not resolve this Issue entirely. It is currently checking if content or embeds are null.

InvalidDiscordResponse should not be raised if content is null and at least one Embed is in embeds.