aboutsummaryrefslogtreecommitdiff
path: root/discord/abc.py
diff options
context:
space:
mode:
authorNadir Chowdhury <[email protected]>2021-07-31 02:25:41 +0100
committerGitHub <[email protected]>2021-07-30 21:25:41 -0400
commit60d82cf908e537e4ea5f068a31377452a9d6db3d (patch)
tree9632e3e99759ad5818047a5132ca39afa30c0749 /discord/abc.py
parentFix user cache acting incorrectly with evictions (diff)
downloaddiscord.py-60d82cf908e537e4ea5f068a31377452a9d6db3d.tar.xz
discord.py-60d82cf908e537e4ea5f068a31377452a9d6db3d.zip
implement guild stickers
Diffstat (limited to 'discord/abc.py')
-rw-r--r--discord/abc.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/discord/abc.py b/discord/abc.py
index a2f4a847..2ed7b513 100644
--- a/discord/abc.py
+++ b/discord/abc.py
@@ -31,12 +31,11 @@ from typing import (
Callable,
Dict,
List,
- Mapping,
Optional,
TYPE_CHECKING,
Protocol,
+ Sequence,
Tuple,
- Type,
TypeVar,
Union,
overload,
@@ -53,6 +52,7 @@ from .role import Role
from .invite import Invite
from .file import File
from .voice_client import VoiceClient, VoiceProtocol
+from .sticker import GuildSticker, StickerItem
from . import utils
__all__ = (
@@ -1164,6 +1164,7 @@ class Messageable:
tts: bool = ...,
embed: Embed = ...,
file: File = ...,
+ stickers: Sequence[Union[GuildSticker, StickerItem]] = ...,
delete_after: float = ...,
nonce: Union[str, int] = ...,
allowed_mentions: AllowedMentions = ...,
@@ -1181,6 +1182,7 @@ class Messageable:
tts: bool = ...,
embed: Embed = ...,
files: List[File] = ...,
+ stickers: Sequence[Union[GuildSticker, StickerItem]] = ...,
delete_after: float = ...,
nonce: Union[str, int] = ...,
allowed_mentions: AllowedMentions = ...,
@@ -1198,6 +1200,7 @@ class Messageable:
tts: bool = ...,
embeds: List[Embed] = ...,
file: File = ...,
+ stickers: Sequence[Union[GuildSticker, StickerItem]] = ...,
delete_after: float = ...,
nonce: Union[str, int] = ...,
allowed_mentions: AllowedMentions = ...,
@@ -1215,6 +1218,7 @@ class Messageable:
tts: bool = ...,
embeds: List[Embed] = ...,
files: List[File] = ...,
+ stickers: Sequence[Union[GuildSticker, StickerItem]] = ...,
delete_after: float = ...,
nonce: Union[str, int] = ...,
allowed_mentions: AllowedMentions = ...,
@@ -1233,6 +1237,7 @@ class Messageable:
embeds=None,
file=None,
files=None,
+ stickers=None,
delete_after=None,
nonce=None,
allowed_mentions=None,
@@ -1305,6 +1310,10 @@ class Messageable:
A list of embeds to upload. Must be a maximum of 10.
.. versionadded:: 2.0
+ stickers: Sequence[Union[:class:`GuildSticker`, :class:`StickerItem`]]
+ A list of stickers to upload. Must be a maximum of 3.
+
+ .. versionadded:: 2.0
Raises
--------
@@ -1340,6 +1349,9 @@ class Messageable:
raise InvalidArgument('embeds parameter must be a list of up to 10 elements')
embeds = [embed.to_dict() for embed in embeds]
+ if stickers is not None:
+ stickers = [sticker.id for sticker in stickers]
+
if allowed_mentions is not None:
if state.allowed_mentions is not None:
allowed_mentions = state.allowed_mentions.merge(allowed_mentions).to_dict()
@@ -1384,6 +1396,7 @@ class Messageable:
embeds=embeds,
nonce=nonce,
message_reference=reference,
+ stickers=stickers,
components=components,
)
finally:
@@ -1406,6 +1419,7 @@ class Messageable:
nonce=nonce,
allowed_mentions=allowed_mentions,
message_reference=reference,
+ stickers=stickers,
components=components,
)
finally:
@@ -1421,6 +1435,7 @@ class Messageable:
nonce=nonce,
allowed_mentions=allowed_mentions,
message_reference=reference,
+ stickers=stickers,
components=components,
)
@@ -1454,7 +1469,7 @@ class Messageable:
This means that both ``with`` and ``async with`` work with this.
Example Usage: ::
-
+
async with channel.typing():
# simulate something heavy
await asyncio.sleep(10)