File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 26
26
27
27
from typing import Callable , Optional
28
28
29
+ import traceback
30
+ import sys
31
+
29
32
from .client import Client
30
33
from .shard import AutoShardedClient
31
34
from .utils import get
@@ -189,8 +192,12 @@ async def register_commands(self) -> None:
189
192
update_guild_commands [guild_id ] = to_update + [as_dict ]
190
193
191
194
for guild_id in update_guild_commands :
192
- cmds = await self .http .bulk_upsert_guild_commands (self .user .id , guild_id ,
193
- update_guild_commands [guild_id ])
195
+ try :
196
+ cmds = await self .http .bulk_upsert_guild_commands (self .user .id , guild_id ,
197
+ update_guild_commands [guild_id ])
198
+ except Forbidden :
199
+ print (f'Ignoring exception running bulk_upsert_guild_commands on guild { guild_id } ' , file = sys .stderr )
200
+ traceback .print_exc ()
194
201
for i in cmds :
195
202
cmd = get (self .to_register , name = i ["name" ], description = i ["description" ], type = i ['type' ])
196
203
self .app_commands [i ["id" ]] = cmd
You can’t perform that action at this time.
0 commit comments