4141)
4242
4343import discord
44+ from discord .partial_emoji import EMOJIS_MAP
4445
4546from .errors import *
4647
@@ -851,7 +852,8 @@ async def convert(self, ctx: Context, argument: str) -> discord.GuildEmoji:
851852class PartialEmojiConverter (Converter [discord .PartialEmoji ]):
852853 """Converts to a :class:`~discord.PartialEmoji`.
853854
854- This is done by extracting the animated flag, name and ID from the emoji.
855+ This is done by extracting the animated flag, name, and ID for custom emojis,
856+ or by using the standard Unicode emojis supported by Discord.
855857
856858 .. versionchanged:: 1.5
857859 Raise :exc:`.PartialEmojiConversionFailure` instead of generic :exc:`.BadArgument`
@@ -872,6 +874,14 @@ async def convert(self, ctx: Context, argument: str) -> discord.PartialEmoji:
872874 id = emoji_id ,
873875 )
874876
877+ if argument in EMOJIS_MAP .values ():
878+ return discord .PartialEmoji .with_state (
879+ ctx .bot ._connection ,
880+ animated = False ,
881+ name = argument ,
882+ id = None ,
883+ )
884+
875885 raise PartialEmojiConversionFailure (argument )
876886
877887
@@ -1094,7 +1104,11 @@ def get_converter(param: inspect.Parameter) -> Any:
10941104
10951105
10961106def is_generic_type (tp : Any , * , _GenericAlias : type = _GenericAlias ) -> bool :
1097- return isinstance (tp , type ) and issubclass (tp , Generic ) or isinstance (tp , _GenericAlias ) # type: ignore
1107+ return (
1108+ isinstance (tp , type )
1109+ and issubclass (tp , Generic )
1110+ or isinstance (tp , _GenericAlias )
1111+ ) # type: ignore
10981112
10991113
11001114CONVERTER_MAPPING : dict [type [Any ], Any ] = {
0 commit comments