Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

✨ Added sticker support #292

Merged
merged 20 commits into from
Dec 11, 2021
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions pincer/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
from collections import defaultdict
from importlib import import_module
from inspect import isasyncgenfunction
from typing import Any, Dict, List, Optional, Tuple, Union, overload
from typing import (
Any, Dict, List, Optional, Tuple, Union, overload, AsyncIterator
)
from typing import TYPE_CHECKING

from . import __package__
Expand All @@ -22,7 +24,7 @@
from .middleware import middleware
from .objects import (
Role, Channel, DefaultThrottleHandler, User, Guild, Intents,
GuildTemplate
GuildTemplate, StickerPack
)
from .utils.conversion import construct_client_dict
from .utils.event_mgr import EventMgr
Expand Down Expand Up @@ -857,4 +859,17 @@ async def get_webhook(
"""
return await Webhook.from_id(self, id, token)

async def sticker_packs(self) -> AsyncGenerator[StickerPack, None]:
Enderchief marked this conversation as resolved.
Show resolved Hide resolved
"""|coro|
Yields sticker packs available to Nitro subscribers.

Yields
------
:class:`~pincer.objects.message.sticker.StickerPack`
a sticker pack
"""
packs = await self.http.get("sticker-packs")
for pack in packs:
yield StickerPack.from_dict(pack)

Bot = Client
Loading