Fix AttributeError from slash command tree (#6103)

This commit is contained in:
Vexed 2023-04-27 21:20:18 +01:00 committed by GitHub
parent 5fecff0779
commit db1892da65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,7 +81,7 @@ class RedTree(CommandTree):
raise CommandAlreadyRegistered(name, None)
if key in self._context_menus:
if not override:
raise discord.errors.CommandAlreadyRegistered(name, None)
raise CommandAlreadyRegistered(name, None)
del self._context_menus[key]
self._disabled_context_menus[key] = command
@ -97,10 +97,10 @@ class RedTree(CommandTree):
# Handle cases where the command already is in the tree
if not override and name in self._disabled_global_commands:
raise discord.errors.CommandAlreadyRegistered(name, None)
raise CommandAlreadyRegistered(name, None)
if name in self._global_commands:
if not override:
raise discord.errors.CommandAlreadyRegistered(name, None)
raise CommandAlreadyRegistered(name, None)
del self._global_commands[name]
self._disabled_global_commands[name] = root