8989 from .guild import Guild
9090 from .member import Member
9191 from .message import Message , MessageReference , PartialMessage
92+ from .poll import Poll
9293 from .state import ConnectionState
9394 from .threads import Thread
9495 from .types .channel import Channel as ChannelPayload
@@ -115,7 +116,7 @@ async def _single_delete_strategy(
115116
116117
117118async def _purge_messages_helper (
118- channel : TextChannel | Thread | VoiceChannel ,
119+ channel : TextChannel | StageChannel | Thread | VoiceChannel ,
119120 * ,
120121 limit : int | None = 100 ,
121122 check : Callable [[Message ], bool ] = MISSING ,
@@ -1345,12 +1346,13 @@ async def send(
13451346 file : File = ...,
13461347 stickers : Sequence [GuildSticker | StickerItem ] = ...,
13471348 delete_after : float = ...,
1348- nonce : str | int = ...,
1349+ nonce : int | str = ...,
13491350 enforce_nonce : bool = ...,
13501351 allowed_mentions : AllowedMentions = ...,
13511352 reference : Message | MessageReference | PartialMessage = ...,
13521353 mention_author : bool = ...,
13531354 view : View = ...,
1355+ poll : Poll = ...,
13541356 suppress : bool = ...,
13551357 silent : bool = ...,
13561358 ) -> Message : ...
@@ -1365,12 +1367,13 @@ async def send(
13651367 files : list [File ] = ...,
13661368 stickers : Sequence [GuildSticker | StickerItem ] = ...,
13671369 delete_after : float = ...,
1368- nonce : str | int = ...,
1370+ nonce : int | str = ...,
13691371 enforce_nonce : bool = ...,
13701372 allowed_mentions : AllowedMentions = ...,
13711373 reference : Message | MessageReference | PartialMessage = ...,
13721374 mention_author : bool = ...,
13731375 view : View = ...,
1376+ poll : Poll = ...,
13741377 suppress : bool = ...,
13751378 silent : bool = ...,
13761379 ) -> Message : ...
@@ -1385,12 +1388,13 @@ async def send(
13851388 file : File = ...,
13861389 stickers : Sequence [GuildSticker | StickerItem ] = ...,
13871390 delete_after : float = ...,
1388- nonce : str | int = ...,
1391+ nonce : int | str = ...,
13891392 enforce_nonce : bool = ...,
13901393 allowed_mentions : AllowedMentions = ...,
13911394 reference : Message | MessageReference | PartialMessage = ...,
13921395 mention_author : bool = ...,
13931396 view : View = ...,
1397+ poll : Poll = ...,
13941398 suppress : bool = ...,
13951399 silent : bool = ...,
13961400 ) -> Message : ...
@@ -1405,12 +1409,13 @@ async def send(
14051409 files : list [File ] = ...,
14061410 stickers : Sequence [GuildSticker | StickerItem ] = ...,
14071411 delete_after : float = ...,
1408- nonce : str | int = ...,
1412+ nonce : int | str = ...,
14091413 enforce_nonce : bool = ...,
14101414 allowed_mentions : AllowedMentions = ...,
14111415 reference : Message | MessageReference | PartialMessage = ...,
14121416 mention_author : bool = ...,
14131417 view : View = ...,
1418+ poll : Poll = ...,
14141419 suppress : bool = ...,
14151420 silent : bool = ...,
14161421 ) -> Message : ...
@@ -1432,6 +1437,7 @@ async def send(
14321437 reference = None ,
14331438 mention_author = None ,
14341439 view = None ,
1440+ poll = None ,
14351441 suppress = None ,
14361442 silent = None ,
14371443 ):
@@ -1465,7 +1471,7 @@ async def send(
14651471 The file to upload.
14661472 files: List[:class:`~discord.File`]
14671473 A list of files to upload. Must be a maximum of 10.
1468- nonce: :class:`int`
1474+ nonce: Union[ :class:`str`, :class:` int`]
14691475 The nonce to use for sending this message. If the message was successfully sent,
14701476 then the message will have a nonce with this value.
14711477 enforce_nonce: Optional[:class:`bool`]
@@ -1515,6 +1521,10 @@ async def send(
15151521 Whether to suppress push and desktop notifications for the message.
15161522
15171523 .. versionadded:: 2.4
1524+ poll: :class:`Poll`
1525+ The poll to send.
1526+
1527+ .. versionadded:: 2.6
15181528
15191529 Returns
15201530 -------
@@ -1594,6 +1604,9 @@ async def send(
15941604 else :
15951605 components = None
15961606
1607+ if poll :
1608+ poll = poll .to_dict ()
1609+
15971610 if file is not None and files is not None :
15981611 raise InvalidArgument ("cannot pass both file and files parameter to send()" )
15991612
@@ -1616,6 +1629,7 @@ async def send(
16161629 stickers = stickers ,
16171630 components = components ,
16181631 flags = flags ,
1632+ poll = poll ,
16191633 )
16201634 finally :
16211635 file .close ()
@@ -1643,6 +1657,7 @@ async def send(
16431657 stickers = stickers ,
16441658 components = components ,
16451659 flags = flags ,
1660+ poll = poll ,
16461661 )
16471662 finally :
16481663 for f in files :
@@ -1661,6 +1676,7 @@ async def send(
16611676 stickers = stickers ,
16621677 components = components ,
16631678 flags = flags ,
1679+ poll = poll ,
16641680 )
16651681
16661682 ret = state .create_message (channel = channel , data = data )
0 commit comments