From c5949c42fcc375febab57abb4b046e3f1d63c159 Mon Sep 17 00:00:00 2001 From: Mantou Date: Mon, 22 Jul 2024 15:42:46 +0800 Subject: [PATCH] fix: Subscripted generics cannot be used with class and instance checks --- disnake/message.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/disnake/message.py b/disnake/message.py index d255c59617..a588ff3f5a 100644 --- a/disnake/message.py +++ b/disnake/message.py @@ -25,7 +25,7 @@ from . import utils from .components import ActionRow, MessageComponent, _component_factory from .embeds import Embed -from .emoji import AnyEmoji +from .emoji import AnyEmoji, BaseEmoji from .enums import ChannelType, InteractionType, MessageType, try_enum, try_enum_to_int from .errors import HTTPException from .file import File @@ -93,7 +93,7 @@ def convert_emoji_reaction(emoji: Union[EmojiInputType, Reaction]) -> str: if isinstance(emoji, Reaction): emoji = emoji.emoji - if isinstance(emoji, AnyEmoji): + if isinstance(emoji, BaseEmoji): return f"{emoji.name}:{emoji.id}" if isinstance(emoji, PartialEmoji): return emoji._as_reaction()