mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-24 18:13:00 +00:00
Add VoiceChannel and Thread to isinstance checks
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user