From 0d05cd273e7e7c554577dba489db54824782cc52 Mon Sep 17 00:00:00 2001 From: z03h <7235242+z03h@users.noreply.github.com> Date: Mon, 16 May 2022 12:32:13 -0700 Subject: [PATCH] Add VoiceChannel and Thread to isinstance checks --- discord/ext/commands/core.py | 4 +++- discord/state.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index c185eacd3..7b57c7e4f 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -2304,7 +2304,9 @@ def is_nsfw() -> Check[Any]: def pred(ctx: Context[BotT]) -> bool: ch = ctx.channel - if ctx.guild is None or (isinstance(ch, (discord.TextChannel, discord.Thread)) and ch.is_nsfw()): + if ctx.guild is None or ( + isinstance(ch, (discord.TextChannel, discord.Thread, discord.VoiceChannel)) and ch.is_nsfw() + ): return True raise NSFWChannelRequired(ch) # type: ignore diff --git a/discord/state.py b/discord/state.py index 4e982c68e..6cec02477 100644 --- a/discord/state.py +++ b/discord/state.py @@ -2571,7 +2571,7 @@ class ConnectionState: # parse_guild_application_commands_update = parse_nothing # Grabbed directly in command iterators def _get_reaction_user(self, channel: MessageableChannel, user_id: int) -> Optional[Union[User, Member]]: - if isinstance(channel, TextChannel): + if isinstance(channel, (TextChannel, Thread, VoiceChannel)): return channel.guild.get_member(user_id) return self.get_user(user_id)