Skip to content

Commit

Permalink
Added error catching of messages that are too big
Browse files Browse the repository at this point in the history
  • Loading branch information
justalemon committed Jun 22, 2023
1 parent fb16185 commit 146ffcf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion leek/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import aiohttp
import aiomysql
from aiomysql import Connection, Pool
from discord import ApplicationContext, AutoShardedBot, DiscordException, Embed, NotFound, SlashCommand
from discord import ApplicationContext, AutoShardedBot, DiscordException, Embed, HTTPException, NotFound, SlashCommand

from .localization import get_default, get_localizations, localize

Expand Down Expand Up @@ -182,6 +182,8 @@ async def on_application_command_error(self, ctx: ApplicationContext, exception:
await ctx.respond(message, ephemeral=True)
except NotFound:
await ctx.send(message, delete_after=60)
except HTTPException:
await ctx.respond(localize("BOT_EXCEPTION_OCURRED", ctx.locale), ephemeral=True)

await super().on_application_command_error(ctx, exception)

Expand Down

0 comments on commit 146ffcf

Please sign in to comment.