mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -05:00
[V3] Send meaningful responses on conversion failure (#1817)
* [V3] Send meaningful responses on conversion failures * Replace existing `discord.ext.commands` imports Just to be sure * Better Permissions converter response
This commit is contained in:
@@ -11,9 +11,8 @@ from pkg_resources import DistributionNotFound
|
||||
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
|
||||
from . import __version__
|
||||
from . import __version__, commands
|
||||
from .data_manager import storage_type
|
||||
from .utils.chat_formatting import inline, bordered, pagify, box
|
||||
from .utils import fuzzy_command_search
|
||||
@@ -185,6 +184,11 @@ def init_events(bot, cli_flags):
|
||||
async def on_command_error(ctx, error):
|
||||
if isinstance(error, commands.MissingRequiredArgument):
|
||||
await ctx.send_help()
|
||||
elif isinstance(error, commands.ConversionFailure):
|
||||
if error.args:
|
||||
await ctx.send(error.args[0])
|
||||
else:
|
||||
await ctx.send_help()
|
||||
elif isinstance(error, commands.BadArgument):
|
||||
await ctx.send_help()
|
||||
elif isinstance(error, commands.DisabledCommand):
|
||||
|
||||
Reference in New Issue
Block a user