File tree Expand file tree Collapse file tree 1 file changed +3
-16
lines changed Expand file tree Collapse file tree 1 file changed +3
-16
lines changed Original file line number Diff line number Diff line change 45
45
46
46
from .client import Client
47
47
from .shard import AutoShardedClient
48
- from .utils import MISSING , get , async_all
48
+ from .utils import MISSING , get , find , async_all
49
49
from .commands import (
50
50
SlashCommand ,
51
51
SlashCommandGroup ,
@@ -186,14 +186,10 @@ async def register_commands(self) -> None:
186
186
cmds = await self .http .bulk_upsert_global_commands (self .user .id , commands )
187
187
188
188
for i in cmds :
189
- # Discord seems to now return None instead of an empty string...
190
- if i ["description" ] is None :
191
- i ['description' ] = ""
192
-
193
189
cmd = get (
194
190
self .pending_application_commands ,
195
191
name = i ["name" ],
196
- description = i [ "description" ] ,
192
+ guild_ids = None ,
197
193
type = i ["type" ],
198
194
)
199
195
self .application_commands [i ["id" ]] = cmd
@@ -229,16 +225,7 @@ async def register_commands(self) -> None:
229
225
raise
230
226
else :
231
227
for i in cmds :
232
- # Discord seems to now return None instead of an empty string...
233
- if i ["description" ] is None :
234
- i ['description' ] = ""
235
-
236
- cmd = get (
237
- self .pending_application_commands ,
238
- name = i ["name" ],
239
- description = i ["description" ],
240
- type = i ["type" ],
241
- )
228
+ cmd = find (lambda cmd : cmd .name == i ["name" ] and cmd .type == i ["type" ] and int (i ["guild_id" ]) in cmd .guild_ids , self .pending_application_commands )
242
229
self .application_commands [i ["id" ]] = cmd
243
230
244
231
# Permissions
You can’t perform that action at this time.
0 commit comments