46
46
from .channel import *
47
47
from .channel import _guild_channel_factory , _threaded_guild_channel_factory
48
48
from .colour import Colour
49
- from .emoji import Emoji , PartialEmoji , _EmojiTag
49
+ from .emoji import GuildEmoji , PartialEmoji , _EmojiTag
50
50
from .enums import (
51
51
AuditLogAction ,
52
52
AutoModEventType ,
@@ -161,7 +161,7 @@ class Guild(Hashable):
161
161
----------
162
162
name: :class:`str`
163
163
The guild name.
164
- emojis: Tuple[:class:`Emoji `, ...]
164
+ emojis: Tuple[:class:`GuildEmoji `, ...]
165
165
All emojis that the guild owns.
166
166
stickers: Tuple[:class:`GuildSticker`, ...]
167
167
All stickers that the guild owns.
@@ -476,7 +476,7 @@ def _from_data(self, guild: GuildPayload) -> None:
476
476
self ._roles [role .id ] = role
477
477
478
478
self .mfa_level : MFALevel = guild .get ("mfa_level" )
479
- self .emojis : tuple [Emoji , ...] = tuple (
479
+ self .emojis : tuple [GuildEmoji , ...] = tuple (
480
480
map (lambda d : state .store_emoji (self , d ), guild .get ("emojis" , []))
481
481
)
482
482
self .stickers : tuple [GuildSticker , ...] = tuple (
@@ -1404,7 +1404,7 @@ async def create_forum_channel(
1404
1404
slowmode_delay : int = MISSING ,
1405
1405
nsfw : bool = MISSING ,
1406
1406
overwrites : dict [Role | Member , PermissionOverwrite ] = MISSING ,
1407
- default_reaction_emoji : Emoji | int | str = MISSING ,
1407
+ default_reaction_emoji : GuildEmoji | int | str = MISSING ,
1408
1408
) -> ForumChannel :
1409
1409
"""|coro|
1410
1410
@@ -1446,10 +1446,10 @@ async def create_forum_channel(
1446
1446
To mark the channel as NSFW or not.
1447
1447
reason: Optional[:class:`str`]
1448
1448
The reason for creating this channel. Shows up on the audit log.
1449
- default_reaction_emoji: Optional[:class:`Emoji ` | :class:`int` | :class:`str`]
1449
+ default_reaction_emoji: Optional[:class:`GuildEmoji ` | :class:`int` | :class:`str`]
1450
1450
The default reaction emoji.
1451
1451
Can be a unicode emoji or a custom emoji in the forms:
1452
- :class:`Emoji `, snowflake ID, string representation (eg. '<a:emoji_name:emoji_id>').
1452
+ :class:`GuildEmoji `, snowflake ID, string representation (eg. '<a:emoji_name:emoji_id>').
1453
1453
1454
1454
.. versionadded:: v2.5
1455
1455
@@ -1502,7 +1502,7 @@ async def create_forum_channel(
1502
1502
options ["nsfw" ] = nsfw
1503
1503
1504
1504
if default_reaction_emoji is not MISSING :
1505
- if isinstance (default_reaction_emoji , _EmojiTag ): # Emoji , PartialEmoji
1505
+ if isinstance (default_reaction_emoji , _EmojiTag ): # GuildEmoji , PartialEmoji
1506
1506
default_reaction_emoji = default_reaction_emoji ._to_partial ()
1507
1507
elif isinstance (default_reaction_emoji , int ):
1508
1508
default_reaction_emoji = PartialEmoji (
@@ -1512,7 +1512,7 @@ async def create_forum_channel(
1512
1512
default_reaction_emoji = PartialEmoji .from_str (default_reaction_emoji )
1513
1513
else :
1514
1514
raise InvalidArgument (
1515
- "default_reaction_emoji must be of type: Emoji | int | str"
1515
+ "default_reaction_emoji must be of type: GuildEmoji | int | str"
1516
1516
)
1517
1517
1518
1518
options ["default_reaction_emoji" ] = (
@@ -2662,10 +2662,10 @@ async def delete_sticker(
2662
2662
"""
2663
2663
await self ._state .http .delete_guild_sticker (self .id , sticker .id , reason )
2664
2664
2665
- async def fetch_emojis (self ) -> list [Emoji ]:
2665
+ async def fetch_emojis (self ) -> list [GuildEmoji ]:
2666
2666
r"""|coro|
2667
2667
2668
- Retrieves all custom :class:`Emoji `\s from the guild.
2668
+ Retrieves all custom :class:`GuildEmoji `\s from the guild.
2669
2669
2670
2670
.. note::
2671
2671
@@ -2678,16 +2678,16 @@ async def fetch_emojis(self) -> list[Emoji]:
2678
2678
2679
2679
Returns
2680
2680
--------
2681
- List[:class:`Emoji `]
2681
+ List[:class:`GuildEmoji `]
2682
2682
The retrieved emojis.
2683
2683
"""
2684
2684
data = await self ._state .http .get_all_custom_emojis (self .id )
2685
- return [Emoji (guild = self , state = self ._state , data = d ) for d in data ]
2685
+ return [GuildEmoji (guild = self , state = self ._state , data = d ) for d in data ]
2686
2686
2687
- async def fetch_emoji (self , emoji_id : int , / ) -> Emoji :
2687
+ async def fetch_emoji (self , emoji_id : int , / ) -> GuildEmoji :
2688
2688
"""|coro|
2689
2689
2690
- Retrieves a custom :class:`Emoji ` from the guild.
2690
+ Retrieves a custom :class:`GuildEmoji ` from the guild.
2691
2691
2692
2692
.. note::
2693
2693
@@ -2701,7 +2701,7 @@ async def fetch_emoji(self, emoji_id: int, /) -> Emoji:
2701
2701
2702
2702
Returns
2703
2703
-------
2704
- :class:`Emoji `
2704
+ :class:`GuildEmoji `
2705
2705
The retrieved emoji.
2706
2706
2707
2707
Raises
@@ -2712,7 +2712,7 @@ async def fetch_emoji(self, emoji_id: int, /) -> Emoji:
2712
2712
An error occurred fetching the emoji.
2713
2713
"""
2714
2714
data = await self ._state .http .get_custom_emoji (self .id , emoji_id )
2715
- return Emoji (guild = self , state = self ._state , data = data )
2715
+ return GuildEmoji (guild = self , state = self ._state , data = data )
2716
2716
2717
2717
async def create_custom_emoji (
2718
2718
self ,
@@ -2721,10 +2721,10 @@ async def create_custom_emoji(
2721
2721
image : bytes ,
2722
2722
roles : list [Role ] = MISSING ,
2723
2723
reason : str | None = None ,
2724
- ) -> Emoji :
2724
+ ) -> GuildEmoji :
2725
2725
r"""|coro|
2726
2726
2727
- Creates a custom :class:`Emoji ` for the guild.
2727
+ Creates a custom :class:`GuildEmoji ` for the guild.
2728
2728
2729
2729
There is currently a limit of 50 static and animated emojis respectively per guild,
2730
2730
unless the guild has the ``MORE_EMOJI`` feature which extends the limit to 200.
@@ -2753,7 +2753,7 @@ async def create_custom_emoji(
2753
2753
2754
2754
Returns
2755
2755
--------
2756
- :class:`Emoji `
2756
+ :class:`GuildEmoji `
2757
2757
The created emoji.
2758
2758
"""
2759
2759
@@ -2769,7 +2769,7 @@ async def delete_emoji(
2769
2769
) -> None :
2770
2770
"""|coro|
2771
2771
2772
- Deletes the custom :class:`Emoji ` from the guild.
2772
+ Deletes the custom :class:`GuildEmoji ` from the guild.
2773
2773
2774
2774
You must have :attr:`~Permissions.manage_emojis` permission to
2775
2775
do this.
0 commit comments