@@ -33,7 +33,7 @@ async def get_channel(self, channel_id: "Snowflake_Type") -> discord_typings.Cha
33
33
channel
34
34
35
35
"""
36
- result = await self .request (Route ("GET" , f "/channels/{ int ( channel_id ) } " ))
36
+ result = await self .request (Route ("GET" , "/channels/{channel_id}" , channel_id = channel_id ))
37
37
return cast (discord_typings .ChannelData , result )
38
38
39
39
@overload
@@ -109,7 +109,9 @@ async def get_channel_messages(
109
109
}
110
110
params = dict_filter_none (params )
111
111
112
- result = await self .request (Route ("GET" , f"/channels/{ int (channel_id )} /messages" ), params = params )
112
+ result = await self .request (
113
+ Route ("GET" , "/channels/{channel_id}/messages" , channel_id = channel_id ), params = params
114
+ )
113
115
return cast (list [discord_typings .MessageData ], result )
114
116
115
117
async def create_guild_channel (
@@ -168,7 +170,9 @@ async def create_guild_channel(
168
170
)
169
171
payload = dict_filter_none (payload )
170
172
171
- result = await self .request (Route ("POST" , f"/guilds/{ int (guild_id )} /channels" ), payload = payload , reason = reason )
173
+ result = await self .request (
174
+ Route ("POST" , "/guilds/{guild_id}/channels" , guild_id = guild_id ), payload = payload , reason = reason
175
+ )
172
176
return cast (discord_typings .ChannelData , result )
173
177
174
178
async def move_channel (
@@ -200,7 +204,9 @@ async def move_channel(
200
204
}
201
205
payload = dict_filter_none (payload )
202
206
203
- await self .request (Route ("PATCH" , f"/guilds/{ int (guild_id )} /channels" ), payload = payload , reason = reason )
207
+ await self .request (
208
+ Route ("PATCH" , "/guilds/{guild_id}/channels" , guild_id = guild_id ), payload = payload , reason = reason
209
+ )
204
210
205
211
async def modify_channel (
206
212
self , channel_id : "Snowflake_Type" , data : dict , reason : str | None = None
@@ -217,7 +223,9 @@ async def modify_channel(
217
223
Channel object on success
218
224
219
225
"""
220
- result = await self .request (Route ("PATCH" , f"/channels/{ int (channel_id )} " ), payload = data , reason = reason )
226
+ result = await self .request (
227
+ Route ("PATCH" , "/channels/{channel_id}" , channel_id = channel_id ), payload = data , reason = reason
228
+ )
221
229
return cast (discord_typings .ChannelData , result )
222
230
223
231
async def delete_channel (self , channel_id : "Snowflake_Type" , reason : str | None = None ) -> None :
@@ -229,7 +237,7 @@ async def delete_channel(self, channel_id: "Snowflake_Type", reason: str | None
229
237
reason: An optional reason for the audit log
230
238
231
239
"""
232
- await self .request (Route ("DELETE" , f "/channels/{ int ( channel_id ) } " ), reason = reason )
240
+ await self .request (Route ("DELETE" , "/channels/{channel_id}" , channel_id = channel_id ), reason = reason )
233
241
234
242
async def get_channel_invites (self , channel_id : "Snowflake_Type" ) -> list [discord_typings .InviteData ]:
235
243
"""
@@ -242,7 +250,7 @@ async def get_channel_invites(self, channel_id: "Snowflake_Type") -> list[discor
242
250
List of invite objects
243
251
244
252
"""
245
- result = await self .request (Route ("GET" , f "/channels/{ int ( channel_id ) } /invites" ))
253
+ result = await self .request (Route ("GET" , "/channels/{channel_id}/invites" , channel_id = channel_id ))
246
254
return cast (list [discord_typings .InviteData ], result )
247
255
248
256
@overload
@@ -336,7 +344,7 @@ async def create_channel_invite(
336
344
payload = dict_filter_none (payload )
337
345
338
346
result = await self .request (
339
- Route ("POST" , f "/channels/{ int ( channel_id ) } /invites" ), payload = payload , reason = reason
347
+ Route ("POST" , "/channels/{channel_id}/invites" , channel_id = channel_id ), payload = payload , reason = reason
340
348
)
341
349
return cast (discord_typings .InviteData , result )
342
350
@@ -361,13 +369,14 @@ async def get_invite(
361
369
362
370
"""
363
371
params : PAYLOAD_TYPE = {
372
+ "invite_code" : invite_code ,
364
373
"with_counts" : with_counts ,
365
374
"with_expiration" : with_expiration ,
366
375
"guild_scheduled_event_id" : int (scheduled_event_id ) if scheduled_event_id else None ,
367
376
}
368
377
params = dict_filter_none (params )
369
378
370
- result = await self .request (Route ("GET" , f "/invites/{ invite_code } " , params = params ))
379
+ result = await self .request (Route ("GET" , "/invites/{invite_code}" , params = params ))
371
380
return cast (discord_typings .InviteData , result )
372
381
373
382
async def delete_invite (self , invite_code : str , reason : str | None = None ) -> discord_typings .InviteData :
@@ -382,7 +391,7 @@ async def delete_invite(self, invite_code: str, reason: str | None = None) -> di
382
391
The deleted invite object
383
392
384
393
"""
385
- result = await self .request (Route ("DELETE" , f "/invites/{ invite_code } " ), reason = reason )
394
+ result = await self .request (Route ("DELETE" , "/invites/{invite_code}" , invite_code = invite_code ), reason = reason )
386
395
return cast (discord_typings .InviteData , result )
387
396
388
397
async def edit_channel_permission (
@@ -409,7 +418,12 @@ async def edit_channel_permission(
409
418
payload : PAYLOAD_TYPE = {"allow" : allow , "deny" : deny , "type" : perm_type }
410
419
411
420
await self .request (
412
- Route ("PUT" , f"/channels/{ int (channel_id )} /permissions/{ int (overwrite_id )} " ),
421
+ Route (
422
+ "PUT" ,
423
+ "/channels/{channel_id}/permissions/{overwrite_id}" ,
424
+ channel_id = channel_id ,
425
+ overwrite_id = overwrite_id ,
426
+ ),
413
427
payload = payload ,
414
428
reason = reason ,
415
429
)
@@ -429,7 +443,10 @@ async def delete_channel_permission(
429
443
reason: An optional reason for the audit log
430
444
431
445
"""
432
- await self .request (Route ("DELETE" , f"/channels/{ int (channel_id )} /{ int (overwrite_id )} " ), reason = reason )
446
+ await self .request (
447
+ Route ("DELETE" , "/channels/{channel_id}/{overwrite_id}" , channel_id = channel_id , overwrite_id = overwrite_id ),
448
+ reason = reason ,
449
+ )
433
450
434
451
async def follow_news_channel (
435
452
self , channel_id : "Snowflake_Type" , webhook_channel_id : "Snowflake_Type"
@@ -447,7 +464,9 @@ async def follow_news_channel(
447
464
"""
448
465
payload = {"webhook_channel_id" : int (webhook_channel_id )}
449
466
450
- result = await self .request (Route ("POST" , f"/channels/{ int (channel_id )} /followers" ), payload = payload )
467
+ result = await self .request (
468
+ Route ("POST" , "/channels/{channel_id}/followers" , channel_id = channel_id ), payload = payload
469
+ )
451
470
return cast (discord_typings .FollowedChannelData , result )
452
471
453
472
async def trigger_typing_indicator (self , channel_id : "Snowflake_Type" ) -> None :
@@ -458,7 +477,7 @@ async def trigger_typing_indicator(self, channel_id: "Snowflake_Type") -> None:
458
477
channel_id: The id of the channel to "type" in
459
478
460
479
"""
461
- await self .request (Route ("POST" , f "/channels/{ int ( channel_id ) } /typing" ))
480
+ await self .request (Route ("POST" , "/channels/{channel_id}/typing" , channel_id = channel_id ))
462
481
463
482
async def get_pinned_messages (self , channel_id : "Snowflake_Type" ) -> list [discord_typings .MessageData ]:
464
483
"""
@@ -471,7 +490,7 @@ async def get_pinned_messages(self, channel_id: "Snowflake_Type") -> list[discor
471
490
A list of pinned message objects
472
491
473
492
"""
474
- result = await self .request (Route ("GET" , f "/channels/{ int ( channel_id ) } /pins" ))
493
+ result = await self .request (Route ("GET" , "/channels/{channel_id}/pins" , channel_id = channel_id ))
475
494
return cast (list [discord_typings .MessageData ], result )
476
495
477
496
async def create_stage_instance (
@@ -514,7 +533,7 @@ async def get_stage_instance(self, channel_id: "Snowflake_Type") -> discord_typi
514
533
A stage instance.
515
534
516
535
"""
517
- result = await self .request (Route ("GET" , f "/stage-instances/{ int ( channel_id ) } " ))
536
+ result = await self .request (Route ("GET" , "/stage-instances/{channel_id}" , channel_id = channel_id ))
518
537
return cast (discord_typings .StageInstanceData , result )
519
538
520
539
async def modify_stage_instance (
@@ -540,7 +559,7 @@ async def modify_stage_instance(
540
559
payload : PAYLOAD_TYPE = {"topic" : topic , "privacy_level" : privacy_level }
541
560
payload = dict_filter_none (payload )
542
561
result = await self .request (
543
- Route ("PATCH" , f "/stage-instances/{ int ( channel_id ) } " ), payload = payload , reason = reason
562
+ Route ("PATCH" , "/stage-instances/{channel_id}" , channel_id = channel_id ), payload = payload , reason = reason
544
563
)
545
564
return cast (discord_typings .StageInstanceData , result )
546
565
@@ -553,7 +572,7 @@ async def delete_stage_instance(self, channel_id: "Snowflake_Type", reason: str
553
572
reason: The reason for the deletion
554
573
555
574
"""
556
- await self .request (Route ("DELETE" , f "/stage-instances/{ int ( channel_id ) } " ), reason = reason )
575
+ await self .request (Route ("DELETE" , "/stage-instances/{channel_id}" , channel_id = channel_id ), reason = reason )
557
576
558
577
async def create_tag (
559
578
self ,
@@ -582,7 +601,9 @@ async def create_tag(
582
601
}
583
602
payload = dict_filter_none (payload )
584
603
585
- result = await self .request (Route ("POST" , f"/channels/{ int (channel_id )} /tags" ), payload = payload )
604
+ result = await self .request (
605
+ Route ("POST" , "/channels/{channel_id}/tags" , channel_id = channel_id ), payload = payload
606
+ )
586
607
return cast (discord_typings .ChannelData , result )
587
608
588
609
async def edit_tag (
@@ -614,7 +635,9 @@ async def edit_tag(
614
635
}
615
636
payload = dict_filter_none (payload )
616
637
617
- result = await self .request (Route ("PUT" , f"/channels/{ int (channel_id )} /tags/{ int (tag_id )} " ), payload = payload )
638
+ result = await self .request (
639
+ Route ("PUT" , "/channels/{channel_id}/tags/{tag_id}" , channel_id = channel_id , tag_id = tag_id ), payload = payload
640
+ )
618
641
return cast (discord_typings .ChannelData , result )
619
642
620
643
async def delete_tag (self , channel_id : "Snowflake_Type" , tag_id : "Snowflake_Type" ) -> discord_typings .ChannelData :
@@ -625,5 +648,7 @@ async def delete_tag(self, channel_id: "Snowflake_Type", tag_id: "Snowflake_Type
625
648
channel_id: The ID of the forum channel to delete tag it.
626
649
tag_id: The ID of the tag to delete
627
650
"""
628
- result = await self .request (Route ("DELETE" , f"/channels/{ int (channel_id )} /tags/{ int (tag_id )} " ))
651
+ result = await self .request (
652
+ Route ("DELETE" , "/channels/{channel_id}/tags/{tag_id}" , channel_id = channel_id , tag_id = tag_id )
653
+ )
629
654
return cast (discord_typings .ChannelData , result )
0 commit comments