I have a problem with if not arg
(I skip it directly) and I understand that putting arg:
int creates problems for me.
Do you know a solution? I tried w
If you don't specify a required argument while invoking a command, it will cause a MissingRequiredArgument error and it won't execute your function. You just have to add this error in your clear_error
function like so:
@clear.error
async def clear_error(ctx, error):
embed = discord.Embed(color=0xe74c3c)
if isinstance(error, commands.CheckFailure):
embed.set_author(
name="You're not authorized to delete messages!",
icon_url='your image'
)
elif isinstance(error, commands.MissingRequiredArgument):
embed.set_author(
name="You need to specify how many messages you want to delete!",
icon_url='your image'
)
await ctx.send(embed=embed, delete_after=10.0)
Also, you won't need your if not arg
anymore