Skip to content

Commit 718b68f

Browse files
committed
fix: enhance PartialEmojiConverter to support direct emoji names
1 parent 2447303 commit 718b68f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

discord/ext/commands/converter.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
)
4242

4343
import discord
44+
from discord.partial_emoji import EMOJIS_MAP
4445

4546
from .errors import *
4647

@@ -872,8 +873,13 @@ async def convert(self, ctx: Context, argument: str) -> discord.PartialEmoji:
872873
id=emoji_id,
873874
)
874875

875-
if argument:
876-
return discord.PartialEmoji(name=argument)
876+
if argument in EMOJIS_MAP.values():
877+
return discord.PartialEmoji.with_state(
878+
ctx.bot._connection,
879+
animated=False,
880+
name=argument,
881+
id=None,
882+
)
877883

878884
raise PartialEmojiConversionFailure(argument)
879885

0 commit comments

Comments
 (0)