Core - Add invoke error message customisation (#5894)

Co-authored-by: Jakub Kuczys <me@jacken.men>
This commit is contained in:
Predä
2022-12-30 04:43:37 +01:00
committed by GitHub
parent 88a348210c
commit 60a9d47003
5 changed files with 76 additions and 13 deletions

View File

@@ -118,13 +118,12 @@ class TriviaSession:
self.stop()
except Exception as exc:
LOG.error("A trivia session has encountered an error.\n", exc_info=exc)
asyncio.create_task(
self.ctx.send(
_(
"An unexpected error occurred in the trivia session.\nCheck your console or logs for details."
)
msg = _("An unexpected error occurred in the trivia session.")
if self.ctx.author.id in self.ctx.bot.owner_ids:
msg = _(
"An unexpected error occurred in the trivia session.\nCheck your console or logs for details."
)
)
asyncio.create_task(self.ctx.send(msg))
self.stop()
async def run(self):