Protect against errors
Some checks are pending
Create and publish a Docker image / build-and-push-image (push) Waiting to run

This commit is contained in:
Parker M. 2025-03-25 23:17:22 -05:00
parent b343d0d45b
commit 03e7111604
Signed by: parker
GPG Key ID: 505ED36FC12B5D5E

View File

@ -19,7 +19,12 @@ class Toggle(commands.Cog):
self.bot.youtube_broken = True
return await ctx.send("YouTube has been marked as broken.")
await ctx.send("Invalid action. Please use 'on' or 'off'.")
@toggle.error
async def toggle_error(self, ctx, error):
if isinstance(error, commands.BadLiteralArgument):
return await ctx.send("Invalid action. Use either 'on' or 'off'.")
else:
return await ctx.send("An unknown error occurred.")
async def setup(bot):