mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
handle check failure errors properly
This commit is contained in:
parent
6e84204165
commit
09991dcefd
1 changed files with 6 additions and 0 deletions
|
@ -49,6 +49,12 @@ class Bot(commands.Bot):
|
||||||
self.console.log("Exit target 2 reached, shutting down (not connecting to discord).")
|
self.console.log("Exit target 2 reached, shutting down (not connecting to discord).")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
async def on_error(self, event: str, *args, **kwargs):
|
||||||
|
e_type, e, tb = sys.exc_info()
|
||||||
|
if isinstance(e, discord.CheckFailure) and str(e) == 'The global check once functions failed.':
|
||||||
|
return
|
||||||
|
await super().on_error(event, *args, **kwargs)
|
||||||
|
|
||||||
async def close(self) -> None:
|
async def close(self) -> None:
|
||||||
if getattr(self, "web", None) is not None:
|
if getattr(self, "web", None) is not None:
|
||||||
await self.http.close()
|
await self.http.close()
|
||||||
|
|
Loading…
Reference in a new issue