Skip to content

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

@Snawe

Description

@Snawe

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfeature requestNew feature request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions