3 Commits
Author SHA1 Message Date
guus 56f90e7829 Merge pull request 'add better user error handling' (#37) from user-error-handling into master
Reviewed-on: #37
Reviewed-by: Mark Hoekveen <mark@hoekveen.net>
2026-10-08 22:31:10 +02:00
guus 38877451c5 add better user error handling 2026-10-08 18:29:46 +02:00
mark b3efbaa291 Merge pull request 'beleefdheid' (#36) from beleefd into master
continuous-integration/drone/push Build is failing
Reviewed-on: #36
2026-08-03 21:49:26 +02:00
+15
View File
@@ -29,6 +29,21 @@ intents.members = True
bot = commands.Bot(command_prefix=commands.when_mentioned_or('!'), description='Stroopwafel. Shitpost bot extraordinaire.', pm_help=True, intents=intents)
@bot.event
async def on_command_error(ctx, error):
if isinstance(error, commands.BadArgument):
await ctx.send(f"{ctx.author.mention} Onheus gebruik van het commando. Lees de docs nog eens door:")
await ctx.send_help(ctx.command)
return
if isinstance(error, commands.MissingRequiredArgument):
await ctx.send(f"{ctx.author.mention} Volgens bij ben je nog iets vergeten toe te voegen aan dit commando. Lees de docs nog eens door:")
await ctx.send_help(ctx.command)
return
if isinstance(error, commands.CommandNotFound):
await ctx.send(f"{ctx.author.mention} Vermoedelijk bedoelde je iets anders. Typ !help voor alle opties.")
return
raise error
@bot.event
async def on_ready():
await add_cogs(bot)