Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

respond() uses MISSING for embeds but send() is using None #303

Closed
Snawe opened this issue Oct 22, 2021 · 1 comment · Fixed by #892
Closed

respond() uses MISSING for embeds but send() is using None #303

Snawe opened this issue Oct 22, 2021 · 1 comment · Fixed by #892
Labels
bug Something isn't working feature request New feature request
Milestone

Comments

@Snawe
Copy link
Contributor

Snawe commented Oct 22, 2021

Summary

The new interaction resond() is using utils.MISSING for messages without embeds

What is the feature request for?

The core library

The Problem

respond() and send() are behaving differently in that way.

Example:
I am using a wrapper function like:

    async def channel_send(self, ctx, embed = None, text = None, view = None):
            if isinstance(ctx, discord.ext.commands.context.Context):
                message = await ctx.channel.send(content=text, embed=embed, view=view)
            elif isinstance(ctx, discord.commands.ApplicationContext):
                await ctx.respond(content=text, embed=embed, view=view)
                message = await ctx.interaction.original_message()

to support both slash commands and current prefix commands. But with the current behavior, embed=None would not work

The Ideal Solution

Also use None als default value for respond()

The Current Solution

Currently I am using it like this:

    async def channel_send(self, ctx, embed = None, text = None, view = None):
            if isinstance(ctx, discord.ext.commands.context.Context):
                message = await ctx.channel.send(content=text, embed=embed, view=view)
            elif isinstance(ctx, discord.commands.ApplicationContext):
                await ctx.respond(content=text, embed=embed if embed else discord.utils.MISSING, view=view)
                message = await ctx.interaction.original_message()
@Snawe Snawe added the feature request New feature request label Oct 22, 2021
@Snawe
Copy link
Contributor Author

Snawe commented Oct 23, 2021

BTW: I just saw that view also needs MISSING and its not just a respond() related "issue", it affects all interactions.

@Lulalaby Lulalaby added the bug Something isn't working label Oct 30, 2021
@Lulalaby Lulalaby added this to the v2.0 milestone Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature request New feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants