Browse Source

chore: Update overloads typings

pull/10166/head
DA-344 1 month ago
parent
commit
0621b38b11
  1. 46
      discord/channel.py
  2. 17
      discord/webhook/async_.py
  3. 37
      discord/webhook/sync.py

46
discord/channel.py

@ -2846,15 +2846,15 @@ class ForumChannel(discord.abc.GuildChannel, Hashable):
self,
*,
name: str,
auto_archive_duration: ThreadArchiveDuration = MISSING,
slowmode_delay: Optional[int] = None,
file: File = MISSING,
files: Sequence[File] = MISSING,
allowed_mentions: AllowedMentions = MISSING,
mention_author: bool = MISSING,
auto_archive_duration: ThreadArchiveDuration = ...,
slowmode_delay: Optional[int] = ...,
file: File = ...,
files: Sequence[File] = ...,
allowed_mentions: AllowedMentions = ...,
mention_author: bool = ...,
view: LayoutView,
suppress_embeds: bool = False,
reason: Optional[str] = None,
suppress_embeds: bool = ...,
reason: Optional[str] = ...,
) -> ThreadWithMessage:
...
@ -2863,21 +2863,21 @@ class ForumChannel(discord.abc.GuildChannel, Hashable):
self,
*,
name: str,
auto_archive_duration: ThreadArchiveDuration = MISSING,
slowmode_delay: Optional[int] = None,
content: Optional[str] = None,
tts: bool = False,
embed: Embed = MISSING,
embeds: Sequence[Embed] = MISSING,
file: File = MISSING,
files: Sequence[File] = MISSING,
stickers: Sequence[Union[GuildSticker, StickerItem]] = MISSING,
allowed_mentions: AllowedMentions = MISSING,
mention_author: bool = MISSING,
applied_tags: Sequence[ForumTag] = MISSING,
view: View = MISSING,
suppress_embeds: bool = False,
reason: Optional[str] = None,
auto_archive_duration: ThreadArchiveDuration = ...,
slowmode_delay: Optional[int] = ...,
content: Optional[str] = ...,
tts: bool = ...,
embed: Embed = ...,
embeds: Sequence[Embed] = ...,
file: File = ...,
files: Sequence[File] = ...,
stickers: Sequence[Union[GuildSticker, StickerItem]] = ...,
allowed_mentions: AllowedMentions = ...,
mention_author: bool = ...,
applied_tags: Sequence[ForumTag] = ...,
view: View = ...,
suppress_embeds: bool = ...,
reason: Optional[str] = ...,
) -> ThreadWithMessage:
...

17
discord/webhook/async_.py

@ -1983,7 +1983,10 @@ class Webhook(BaseWebhook):
self,
message_id: int,
*,
attachments: Sequence[Union[Attachment, File]] = ...,
view: LayoutView,
allowed_mentions: Optional[AllowedMentions] = ...,
thread: Snowflake = ...,
) -> WebhookMessage:
...
@ -1992,13 +1995,13 @@ class Webhook(BaseWebhook):
self,
message_id: int,
*,
content: Optional[str] = MISSING,
embeds: Sequence[Embed] = MISSING,
embed: Optional[Embed] = MISSING,
attachments: Sequence[Union[Attachment, File]] = MISSING,
view: Optional[View] = MISSING,
allowed_mentions: Optional[AllowedMentions] = None,
thread: Snowflake = MISSING,
content: Optional[str] = ...,
embeds: Sequence[Embed] = ...,
embed: Optional[Embed] = ...,
attachments: Sequence[Union[Attachment, File]] = ...,
view: Optional[View] = ...,
allowed_mentions: Optional[AllowedMentions] = ...,
thread: Snowflake = ...,
) -> WebhookMessage:
...

37
discord/webhook/sync.py

@ -1035,7 +1035,7 @@ class SyncWebhook(BaseWebhook):
.. versionadded:: 2.4
view: Union[:class:`~discord.ui.View`, :class:`~discord.ui.LayoutView`]
The view to send with the message. This can only have URL buttons, which donnot
The view to send with the message. This can only have non-interactible items, which donnot
require a state to be attached to it.
If you want to send a view with any component attached to it, check :meth:`Webhook.send`.
@ -1185,6 +1185,33 @@ class SyncWebhook(BaseWebhook):
)
return self._create_message(data, thread=thread)
@overload
def edit_message(
self,
message_id: int,
*,
attachments: Sequence[Union[Attachment, File]] = ...,
view: LayoutView,
allowed_mentions: Optional[AllowedMentions] = ...,
thread: Snowflake = ...,
) -> SyncWebhookMessage:
...
@overload
def edit_message(
self,
message_id: int,
*,
content: Optional[str] = ...,
embeds: Sequence[Embed] = ...,
embed: Optional[Embed] = ...,
attachments: Sequence[Union[Attachment, File]] = ...,
view: Optional[View] = ...,
allowed_mentions: Optional[AllowedMentions] = ...,
thread: Snowflake = ...,
) -> SyncWebhookMessage:
...
def edit_message(
self,
message_id: int,
@ -1193,6 +1220,7 @@ class SyncWebhook(BaseWebhook):
embeds: Sequence[Embed] = MISSING,
embed: Optional[Embed] = MISSING,
attachments: Sequence[Union[Attachment, File]] = MISSING,
view: Optional[BaseView] = MISSING,
allowed_mentions: Optional[AllowedMentions] = None,
thread: Snowflake = MISSING,
) -> SyncWebhookMessage:
@ -1219,6 +1247,13 @@ class SyncWebhook(BaseWebhook):
then all attachments are removed.
.. versionadded:: 2.0
view: Optional[Union[:class:`~discord.ui.View`, :class:`~discord.ui.LayoutView`]]
The updated view to update this message with. This can only have non-interactible items, which donnot
require a state to be attached to it. If ``None`` is passed then the view is removed.
If you want to edit a webhook message with any component attached to it, check :meth:`WebhookMessage.edit`.
.. versionadded:: 2.6
allowed_mentions: :class:`AllowedMentions`
Controls the mentions being processed in this message.
See :meth:`.abc.Messageable.send` for more information.

Loading…
Cancel
Save