File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -95,9 +95,11 @@ def __init__(
95
95
super ().__init__ (
96
96
* args ,
97
97
allowed_roles = allowed_roles ,
98
+ tree_cls = CommandTreeBase ,
98
99
** kwargs ,
99
100
)
100
101
102
+ self .command_error_manager : CommandErrorManager | None = None
101
103
self .guild_id = guild_id
102
104
self .http_session = http_session
103
105
self .api_client = api_client
@@ -119,6 +121,16 @@ def __init__(
119
121
120
122
self .all_extensions : frozenset [str ] | None = None
121
123
124
+ def register_command_error_manager (self , manager : CommandErrorManager ) -> None :
125
+ """
126
+ Bind an instance of the command error manager to both the bot and the command tree.
127
+
128
+ The reason this doesn't happen in the constructor is because error handlers might need an instance of the bot.
129
+ So registration needs to happen once the bot instance has been created.
130
+ """
131
+ self .command_error_manager = manager
132
+ self .tree .command_error_manager = manager
133
+
122
134
def _connect_statsd (
123
135
self ,
124
136
statsd_url : str ,
You can’t perform that action at this time.
0 commit comments