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

Commit

Permalink
🔀 Merge pull request #292 from Endercheif/stickers
Browse files Browse the repository at this point in the history
✨ Added sticker support
  • Loading branch information
Enderchief authored Dec 11, 2021
2 parents e5c7d75 + 3ed81a9 commit 7602811
Show file tree
Hide file tree
Showing 4 changed files with 253 additions and 110 deletions.
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,5 +859,18 @@ async def get_webhook(
"""
return await Webhook.from_id(self, id, token)

async def sticker_packs(self) -> AsyncIterator[StickerPack]:
"""|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

0 comments on commit 7602811

Please sign in to comment.