aboutsummaryrefslogtreecommitdiff
path: root/discord/message.py
diff options
context:
space:
mode:
authorNadir Chowdhury <[email protected]>2021-05-11 01:24:48 +0100
committerGitHub <[email protected]>2021-05-10 20:24:48 -0400
commit757cfad38f340f31f1b18bc198b3aa83e9cbe6dc (patch)
tree9d8f4c643e21aa4310c75090d4a666863247014e /discord/message.py
parent [tasks] Add support for explicit time parameter (diff)
downloaddiscord.py-757cfad38f340f31f1b18bc198b3aa83e9cbe6dc.tar.xz
discord.py-757cfad38f340f31f1b18bc198b3aa83e9cbe6dc.zip
Type up **kwargs of various methods
Diffstat (limited to 'discord/message.py')
-rw-r--r--discord/message.py24
1 files changed, 21 insertions, 3 deletions
diff --git a/discord/message.py b/discord/message.py
index 68c78001..9016960a 100644
--- a/discord/message.py
+++ b/discord/message.py
@@ -29,7 +29,7 @@ import datetime
import re
import io
from os import PathLike
-from typing import TYPE_CHECKING, Union, List, Optional, Any, Callable, Tuple, ClassVar
+from typing import TYPE_CHECKING, Union, List, Optional, Any, Callable, Tuple, ClassVar, Optional, overload
from . import utils
from .reaction import Reaction
@@ -63,6 +63,7 @@ if TYPE_CHECKING:
from .abc import GuildChannel
from .state import ConnectionState
from .channel import TextChannel, GroupChannel, DMChannel
+ from .mentions import AllowedMentions
EmojiInputType = Union[Emoji, PartialEmoji, str]
@@ -398,7 +399,7 @@ class MessageReference:
return self
@classmethod
- def from_message(cls, message: Message, *, fail_if_not_exists: bool = True):
+ def from_message(cls, message: Message, *, fail_if_not_exists: bool = True) -> MessageReference:
"""Creates a :class:`MessageReference` from an existing :class:`~discord.Message`.
.. versionadded:: 1.6
@@ -1077,7 +1078,24 @@ class Message(Hashable):
else:
await self._state.http.delete_message(self.channel.id, self.id)
- async def edit(self, **fields: Any) -> None:
+ @overload
+ async def edit(
+ self,
+ *,
+ content: Optional[str] = ...,
+ embed: Optional[Embed] = ...,
+ attachments: List[Attachment] = ...,
+ suppress: bool = ...,
+ delete_after: Optional[float] = ...,
+ allowed_mentions: Optional[AllowedMentions] = ...,
+ ) -> None:
+ ...
+
+ @overload
+ async def edit(self) -> None:
+ ...
+
+ async def edit(self, **fields) -> None:
"""|coro|
Edits the message.