Handle NSFWChannelRequired in events. (#4933)

This commit is contained in:
PredaaA 2021-04-03 23:23:53 +02:00 committed by GitHub
parent 4813c68185
commit edbd31413b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -294,6 +294,8 @@ def init_events(bot, cli_flags):
await ctx.send(_("That command is not available in DMs.")) await ctx.send(_("That command is not available in DMs."))
elif isinstance(error, commands.PrivateMessageOnly): elif isinstance(error, commands.PrivateMessageOnly):
await ctx.send(_("That command is only available in DMs.")) await ctx.send(_("That command is only available in DMs."))
elif isinstance(error, commands.NSFWChannelRequired):
await ctx.send(_("That command is only available in NSFW channels."))
elif isinstance(error, commands.CheckFailure): elif isinstance(error, commands.CheckFailure):
pass pass
elif isinstance(error, commands.CommandOnCooldown): elif isinstance(error, commands.CommandOnCooldown):