55import asyncio
66import copy
77from abc import ABC
8+ from collections .abc import Mapping , Sequence
89from typing import (
910 TYPE_CHECKING ,
1011 Any ,
1112 Callable ,
12- Dict ,
13- List ,
14- Mapping ,
1513 Optional ,
1614 Protocol ,
17- Sequence ,
18- Tuple ,
1915 TypeVar ,
2016 Union ,
2117 cast ,
@@ -264,7 +260,7 @@ class GuildChannel(ABC):
264260 category_id : Optional [int ]
265261 _flags : int
266262 _state : ConnectionState
267- _overwrites : List [_Overwrites ]
263+ _overwrites : list [_Overwrites ]
268264
269265 if TYPE_CHECKING :
270266
@@ -279,7 +275,7 @@ def __str__(self) -> str:
279275 def _sorting_bucket (self ) -> int :
280276 raise NotImplementedError
281277
282- def _update (self , guild : Guild , data : Dict [str , Any ]) -> None :
278+ def _update (self , guild : Guild , data : dict [str , Any ]) -> None :
283279 raise NotImplementedError
284280
285281 async def _move (
@@ -296,7 +292,7 @@ async def _move(
296292 http = self ._state .http
297293 bucket = self ._sorting_bucket
298294 channels = [c for c in self .guild .channels if c ._sorting_bucket == bucket ]
299- channels = cast ("List [GuildChannel]" , channels )
295+ channels = cast ("list [GuildChannel]" , channels )
300296
301297 channels .sort (key = lambda c : c .position )
302298
@@ -313,7 +309,7 @@ async def _move(
313309 # add ourselves at our designated position
314310 channels .insert (index , self )
315311
316- payload : List [ChannelPositionUpdatePayload ] = []
312+ payload : list [ChannelPositionUpdatePayload ] = []
317313 for index , c in enumerate (channels ):
318314 d : ChannelPositionUpdatePayload = {"id" : c .id , "position" : index }
319315 if parent_id is not MISSING and c .id == self .id :
@@ -379,7 +375,7 @@ async def _edit(
379375
380376 lock_permissions : bool = bool (sync_permissions )
381377
382- overwrites_payload : List [PermissionOverwritePayload ] = MISSING
378+ overwrites_payload : list [PermissionOverwritePayload ] = MISSING
383379
384380 if position is not MISSING :
385381 await self ._move (
@@ -428,7 +424,7 @@ async def _edit(
428424 else :
429425 flags_payload = MISSING
430426
431- available_tags_payload : List [PartialForumTagPayload ] = MISSING
427+ available_tags_payload : list [PartialForumTagPayload ] = MISSING
432428 if available_tags is not MISSING :
433429 available_tags_payload = [tag .to_dict () for tag in available_tags ]
434430
@@ -453,7 +449,7 @@ async def _edit(
453449 if default_layout is not MISSING :
454450 default_layout_payload = try_enum_to_int (default_layout )
455451
456- options : Dict [str , Any ] = {
452+ options : dict [str , Any ] = {
457453 "name" : name ,
458454 "parent_id" : parent_id ,
459455 "topic" : topic ,
@@ -505,11 +501,11 @@ def _fill_overwrites(self, data: GuildChannelPayload) -> None:
505501 tmp [everyone_index ], tmp [0 ] = tmp [0 ], tmp [everyone_index ]
506502
507503 @property
508- def changed_roles (self ) -> List [Role ]:
504+ def changed_roles (self ) -> list [Role ]:
509505 """List[:class:`.Role`]: Returns a list of roles that have been overridden from
510506 their default values in the :attr:`.Guild.roles` attribute.
511507 """
512- ret : List [Role ] = []
508+ ret : list [Role ] = []
513509 g = self .guild
514510 for overwrite in filter (lambda o : o .is_role (), self ._overwrites ):
515511 role = g .get_role (overwrite .id )
@@ -562,7 +558,7 @@ def overwrites_for(self, obj: Union[Role, User]) -> PermissionOverwrite:
562558 return PermissionOverwrite ()
563559
564560 @property
565- def overwrites (self ) -> Dict [Union [Role , Member ], PermissionOverwrite ]:
561+ def overwrites (self ) -> dict [Union [Role , Member ], PermissionOverwrite ]:
566562 """Returns all of the channel's overwrites.
567563
568564 This is returned as a dictionary where the key contains the target which
@@ -1035,7 +1031,7 @@ async def set_permissions(
10351031
10361032 async def _clone_impl (
10371033 self ,
1038- base_attrs : Dict [str , Any ],
1034+ base_attrs : dict [str , Any ],
10391035 * ,
10401036 name : Optional [str ] = None ,
10411037 category : Optional [Snowflake ] = MISSING ,
@@ -1044,7 +1040,7 @@ async def _clone_impl(
10441040 ) -> Self :
10451041 # if the overwrites are MISSING, defaults to the
10461042 # original permissions of the channel
1047- overwrites_payload : List [PermissionOverwritePayload ]
1043+ overwrites_payload : list [PermissionOverwritePayload ]
10481044 if overwrites is not MISSING :
10491045 if not isinstance (overwrites , dict ):
10501046 raise TypeError ("overwrites parameter expects a dict." )
@@ -1250,7 +1246,7 @@ async def move(self, **kwargs: Any) -> None:
12501246 ]
12511247
12521248 channels .sort (key = lambda c : (c .position , c .id ))
1253- channels = cast ("List [GuildChannel]" , channels )
1249+ channels = cast ("list [GuildChannel]" , channels )
12541250
12551251 try :
12561252 # Try to remove ourselves from the channel list
@@ -1273,7 +1269,7 @@ async def move(self, **kwargs: Any) -> None:
12731269 raise ValueError ("Could not resolve appropriate move position" )
12741270
12751271 channels .insert (max ((index + offset ), 0 ), self )
1276- payload : List [ChannelPositionUpdatePayload ] = []
1272+ payload : list [ChannelPositionUpdatePayload ] = []
12771273 lock_permissions = kwargs .get ("sync_permissions" , False )
12781274 reason = kwargs .get ("reason" )
12791275 for index , channel in enumerate (channels ):
@@ -1379,7 +1375,7 @@ async def create_invite(
13791375 invite .guild_scheduled_event = guild_scheduled_event
13801376 return invite
13811377
1382- async def invites (self ) -> List [Invite ]:
1378+ async def invites (self ) -> list [Invite ]:
13831379 """|coro|
13841380
13851381 Returns a list of all active instant invites from this channel.
@@ -1455,7 +1451,7 @@ async def send(
14551451 * ,
14561452 tts : bool = ...,
14571453 embed : Embed = ...,
1458- files : List [File ] = ...,
1454+ files : list [File ] = ...,
14591455 stickers : Sequence [Union [GuildSticker , StandardSticker , StickerItem ]] = ...,
14601456 delete_after : float = ...,
14611457 nonce : Union [str , int ] = ...,
@@ -1475,7 +1471,7 @@ async def send(
14751471 content : Optional [str ] = ...,
14761472 * ,
14771473 tts : bool = ...,
1478- embeds : List [Embed ] = ...,
1474+ embeds : list [Embed ] = ...,
14791475 file : File = ...,
14801476 stickers : Sequence [Union [GuildSticker , StandardSticker , StickerItem ]] = ...,
14811477 delete_after : float = ...,
@@ -1496,8 +1492,8 @@ async def send(
14961492 content : Optional [str ] = ...,
14971493 * ,
14981494 tts : bool = ...,
1499- embeds : List [Embed ] = ...,
1500- files : List [File ] = ...,
1495+ embeds : list [Embed ] = ...,
1496+ files : list [File ] = ...,
15011497 stickers : Sequence [Union [GuildSticker , StandardSticker , StickerItem ]] = ...,
15021498 delete_after : float = ...,
15031499 nonce : Union [str , int ] = ...,
@@ -1517,9 +1513,9 @@ async def send(
15171513 * ,
15181514 tts : bool = False ,
15191515 embed : Optional [Embed ] = None ,
1520- embeds : Optional [List [Embed ]] = None ,
1516+ embeds : Optional [list [Embed ]] = None ,
15211517 file : Optional [File ] = None ,
1522- files : Optional [List [File ]] = None ,
1518+ files : Optional [list [File ]] = None ,
15231519 stickers : Optional [Sequence [Union [GuildSticker , StandardSticker , StickerItem ]]] = None ,
15241520 delete_after : Optional [float ] = None ,
15251521 nonce : Optional [Union [str , int ]] = None ,
@@ -2015,10 +2011,10 @@ class Connectable(Protocol):
20152011 guild : Guild
20162012 id : int
20172013
2018- def _get_voice_client_key (self ) -> Tuple [int , str ]:
2014+ def _get_voice_client_key (self ) -> tuple [int , str ]:
20192015 raise NotImplementedError
20202016
2021- def _get_voice_state_pair (self ) -> Tuple [int , int ]:
2017+ def _get_voice_state_pair (self ) -> tuple [int , int ]:
20222018 raise NotImplementedError
20232019
20242020 async def connect (
0 commit comments