Add VoiceChannel and Thread to isinstance checks

This commit is contained in:
z03h
2022-05-16 12:32:13 -07:00
committed by GitHub
parent 9450a8e972
commit cdf787186e
2 changed files with 4 additions and 2 deletions

View File

@@ -2317,7 +2317,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