Replies: 1 comment
-
Hello, there are multiple ways to add error handling for app commands depending on how you create them, and which style you'd like to use. For regular client = discord.Client(...)
tree = discord.app_commands.CommandTree(client)
@tree.error
async def on_error(interaction: discord.Interaction, error: discord.app_commands.AppCommandError) -> None:
... Or alternatively you can subclass class MyCommandTree(discord.app_commands.CommandTree):
async def on_error(self, interaction: discord.Interaction, error: discord.app_commands.AppCommandError) -> None:
...
client = discord.Client(...)
tree = MyCommandTree(client) If you're using hybrid commands your regular prefix command error handler will be used for app command errors as well. Hope this helps! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
so i know how to add error handling to discord.py with like prefix commands but im new to slash commands i dont know how can you help?
Beta Was this translation helpful? Give feedback.
All reactions