Browse Source

Rename instances of nitro to premium

pull/7313/head
Rapptz 4 years ago
parent
commit
6beef898c6
  1. 10
      discord/client.py
  2. 2
      discord/flags.py
  3. 2
      discord/http.py
  4. 2
      discord/member.py
  5. 4
      discord/sticker.py
  6. 2
      discord/types/sticker.py

10
discord/client.py

@ -794,7 +794,7 @@ class Client:
.. note::
To retrieve standard stickers, use :meth:`.fetch_sticker`.
or :meth:`.fetch_nitro_sticker_packs`.
or :meth:`.fetch_premium_sticker_packs`.
Returns
--------
@ -1492,10 +1492,10 @@ class Client:
cls, _ = _sticker_factory(data['type']) # type: ignore
return cls(state=self._connection, data=data) # type: ignore
async def fetch_nitro_sticker_packs(self) -> List[StickerPack]:
async def fetch_premium_sticker_packs(self) -> List[StickerPack]:
"""|coro|
Retrieves all available nitro sticker packs.
Retrieves all available premium sticker packs.
.. versionadded:: 2.0
@ -1507,9 +1507,9 @@ class Client:
Returns
---------
List[:class:`.StickerPack`]
All available nitro sticker packs.
All available premium sticker packs.
"""
data = await self.http.list_nitro_sticker_packs()
data = await self.http.list_premium_sticker_packs()
return [StickerPack(state=self._connection, data=pack) for pack in data['sticker_packs']]
async def create_dm(self, user: Snowflake) -> DMChannel:

2
discord/flags.py

@ -205,7 +205,7 @@ class SystemChannelFlags(BaseFlags):
@flag_value
def premium_subscriptions(self):
""":class:`bool`: Returns ``True`` if the system channel is used for Nitro boosting notifications."""
""":class:`bool`: Returns ``True`` if the system channel is used for "Nitro boosting" notifications."""
return 2
@flag_value

2
discord/http.py

@ -1173,7 +1173,7 @@ class HTTPClient:
def get_sticker(self, sticker_id: Snowflake) -> Response[sticker.Sticker]:
return self.request(Route('GET', '/stickers/{sticker_id}', sticker_id=sticker_id))
def list_nitro_sticker_packs(self) -> Response[sticker.ListNitroStickerPacks]:
def list_premium_sticker_packs(self) -> Response[sticker.ListPremiumStickerPacks]:
return self.request(Route('GET', '/sticker-packs'))
def get_all_guild_stickers(self, guild_id: Snowflake) -> Response[List[sticker.GuildSticker]]:

2
discord/member.py

@ -247,7 +247,7 @@ class Member(discord.abc.Messageable, _UserTag):
.. versionadded:: 1.6
premium_since: Optional[:class:`datetime.datetime`]
An aware datetime object that specifies the date and time in UTC when the member used their
Nitro boost on the guild, if available. This could be ``None``.
"Nitro boost" on the guild, if available. This could be ``None``.
"""
__slots__ = (

4
discord/sticker.py

@ -51,7 +51,7 @@ if TYPE_CHECKING:
Sticker as StickerPayload,
StandardSticker as StandardStickerPayload,
GuildSticker as GuildStickerPayload,
ListNitroStickerPacks as ListNitroStickerPacksPayload
ListPremiumStickerPacks as ListPremiumStickerPacksPayload
)
@ -359,7 +359,7 @@ class StandardSticker(Sticker):
:class:`StickerPack`
The retrieved sticker pack.
"""
data: ListNitroStickerPacksPayload = await self._state.http.list_nitro_sticker_packs()
data: ListPremiumStickerPacksPayload = await self._state.http.list_premium_sticker_packs()
packs = data['sticker_packs']
pack = find(lambda d: int(d['id']) == self.pack_id, packs)

2
discord/types/sticker.py

@ -89,5 +89,5 @@ class EditGuildSticker(TypedDict, total=False):
description: str
class ListNitroStickerPacks(TypedDict):
class ListPremiumStickerPacks(TypedDict):
sticker_packs: List[StickerPack]

Loading…
Cancel
Save