async def on_command_error(self, ctx, error): if isinstance(error, commands.MissingRequiredArgument): msg = f'You appear to be missing the `{error.param.name}` argument required for this command.' await ctx.send(embed=tools.single_embed_tooltip(msg)) if isinstance(error, commands.BadArgument): msg = f'You must declare the `m`, `h`, or `d` denominator separately from your number value. Ex: `1 m`' await ctx.send(embed=tools.single_embed_tooltip(msg))
async def on_command_error(self, ctx, error): prefix = await self.prefix(ctx) if isinstance(error, commands.BadArgument): msg = f'{error}.\n'\ f'To add a positive review, please use `{prefix}pos @member message` '\ f'where `@member` can be a user mention, user ID, or the username in quotes. '\ f'Messages are optional.' await ctx.send(embed=tools.single_embed_tooltip(msg)) if isinstance(error, commands.MissingRequiredArgument): msg = f'You appear to be missing the `{error.param.name}` argument required for this command. ' \ f'Please use `{prefix}pos @member message` for positive reviews. Messages are optional.' await ctx.send(embed=tools.single_embed_tooltip(msg)) if isinstance(error, commands.CommandOnCooldown): msg = f'You\'re doing that too fast! Consider using the `mpos` command instead. \n{error}' await ctx.send(embed=tools.single_embed_tooltip(msg))
async def on_command_error(ctx, error): if isinstance(error, commands.CommandOnCooldown): msg = f'{datetime.now().strftime("%I:%M:%S %p")}\tUser:[{ctx.author}]\tChannel:[{ctx.channel.name}]\tTriggered cooldown [{ctx.command}]' print(msg) elif isinstance(error, commands.CommandNotFound): await ctx.send(embed=tools.single_embed_tooltip( f'I\'m sorry. That command doesn\'t exist.')) msg = f'{datetime.now().strftime("%I:%M:%S %p")}\tUser:[{ctx.author}]\tChannel:[{ctx.channel.name}]\tTriggered CommandNotFound [{ctx.command}]' print(msg) elif isinstance(error, commands.CheckFailure): await ctx.send(embed=tools.single_embed( f'You do not have permission to run this command.'), delete_after=10) msg = f'{datetime.now().strftime("%I:%M:%S %p")}\tUser:[{ctx.author}]\tChannel:[{ctx.channel.name}]\tTriggered permissions error [{ctx.command}]' print(msg) elif isinstance(error, discord.errors.NotFound): msg = f'{datetime.now().strftime("%I:%M:%S %p")}\tUser:[{ctx.author}]\tChannel:[{ctx.channel.name}]\tTriggered permissions error [{ctx.command}]' print(msg) elif isinstance(error, commands.CommandInvokeError): await ctx.send(embed=tools.single_embed( f'An error occurred when running {ctx.command}.')) msg = f'{datetime.now().strftime("%I:%M:%S %p")}\tUser:[{ctx.author}]\tChannel:[{ctx.channel.name}]\tTriggered CommandInvokeError [{ctx.command}] {error}' print(msg) else: msg = f'{datetime.now().strftime("%I:%M:%S %p")}\tUser:[{ctx.author}]\tChannel:[{ctx.channel.name}]\tTriggered an error [{ctx.command}:{error}]' print(msg)
async def on_command_error(self, ctx, error): prefix = await self.prefix(ctx) if isinstance(error, commands.BadArgument): await ctx.message.delete() msg = f'{error}.\n'\ f'To add a negative review, please use `{prefix}neg @member message` '\ f'where `@member` can be a user mention, user ID, or the username in quotes. '\ f'**Messages are required.**' await ctx.send(embed=tools.single_embed_tooltip(msg)) if isinstance(error, commands.MissingRequiredArgument): await ctx.message.delete() msg = f'You appear to be missing the `{error.param.name}` argument required for this command.\n' \ f'Please use `{prefix}neg @member message` for negative reviews. **Messages are required.**' await ctx.send(embed=tools.single_embed_tooltip(msg)) if isinstance(error, commands.CommandOnCooldown): await ctx.message.delete()
async def on_command_error(self, ctx, error): if isinstance(error, commands.MissingRequiredArgument): msg = f'Please enter a message for the bug report.' await ctx.send(embed=tools.single_embed_tooltip(msg))
async def on_command_error(self, ctx, error): if isinstance(error, commands.MissingRequiredArgument): await ctx.send(embed=tools.single_embed_tooltip(f'{error}'))
async def on_command_error(self, ctx, error): prefix = await self.prefix(ctx) if isinstance(error, commands.MissingRequiredArgument): msg = f'You appear to be missing the `{error.param.name}` argument required for this command. ' \ f'Please use `{prefix}sub pos/neg @member points message`. Messages are optional.' await ctx.send(embed=tools.single_embed_tooltip(msg))
async def on_command_error(self, ctx, error): if isinstance(error, commands.MissingRequiredArgument): await ctx.send(embed=tools.single_embed_tooltip(f'You are missing the `{error.param.name}` argument.'), delete_after=30) if isinstance(error, commands.BadArgument): await ctx.send(embed=tools.single_embed(f'{error}'), delete_after=30)