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

Add a kwarg or a way to manage the syncing warning message #886

Open
Balnos opened this issue Dec 5, 2022 · 2 comments
Open

Add a kwarg or a way to manage the syncing warning message #886

Balnos opened this issue Dec 5, 2022 · 2 comments
Labels
feature request Request for a new feature

Comments

@Balnos
Copy link

Balnos commented Dec 5, 2022

Summary

Adding a way to disable the ephemeral message

What is the feature request for?

disnake.ext.commands

The Problem

It would be nice if we got a kwarg or a feature that it help us to remove the syncing warning message, an ephemeral message that disnake provides to warn the user that this command is getting synchronized.

Also discord already shows a special error that the app command is getting updated so it would nice if this would be added because some (like me) will like that discord shows that . (Also sorry if i didnt speak correctly or properly )

The Ideal Solution

Implementing it.

The Current Solution

No response

Additional Context

No response

@Balnos Balnos added the feature request Request for a new feature label Dec 5, 2022
@Balnos Balnos changed the title Add a kwarg or a way to manage the sync message Add a kwarg or a way to manage the syncing warning message Dec 5, 2022
@shiftinv
Copy link
Member

Also discord already shows a special error that the app command is getting updated so it would nice if this would be added because some (like me) will like that discord shows that

That's a client-side error for situations where a user tried to invoke a command that no longer exists on the server-side.

The sync warning messages that show up are used in a slightly different situation: when a command exists on the server-side but no longer in the bot, for example when removing test_guilds which does not un-sync the commands from those guilds.

Unfortunately there's no way for bots to show that first error, it's purely a client-side thing.

@shiftinv
Copy link
Member

Also linking the relevant part of the code here for context, if anyone wants to give it a shot:

if self._command_sync_flags.allow_command_deletion:
try:
await self.bulk_overwrite_guild_commands(interaction.guild_id, []) # type: ignore
except disnake.HTTPException:
# for some reason we were unable to sync the command
# either malformed API request, or some other error
# in theory this will never error: if a command exists the bot has authorisation
# in practice this is not the case, the API could change valid requests at any time
message = "This command could not be processed. Additionally, an error occured when trying to sync commands."
else:
message = "This command has just been synced."
else:
# this block is responsible for responding to guild commands that we don't delete
# this could be changed to not respond but that behavior is undecided
message = "This command could not be processed."
try:
# This part is in a separate try-except because we still should respond to the interaction
message += (
" More information about this: "
"https://docs.disnake.dev/page/ext/commands/additional_info.html#unknown-commands."
)
await interaction.response.send_message(
message,
ephemeral=True,
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

2 participants