error handling in joke response

This commit is contained in:
John Lancaster
2023-06-09 21:42:08 -05:00
parent b2c121a7e7
commit 1affde8471

View File

@@ -50,7 +50,11 @@ class Kwaylon(Client):
f'[light_slate_blue]{joke.__class__.__name__}[/] ' + f'[light_slate_blue]{joke.__class__.__name__}[/] ' +
f'{message.content[:start]}[green]{message.content[start:end]}[/]{message.content[end:]}' f'{message.content[:start]}[green]{message.content[start:end]}[/]{message.content[end:]}'
) )
try:
await joke.respond(message, self, joke_match) await joke.respond(message, self, joke_match)
except Exception as e:
_log.error(f'[bold red]{type(e).__name__}[/] when responding to [cyan1]{type(joke).__name__}[/]')
raise
async def read_command(self, message: Message): async def read_command(self, message: Message):
for mention in message.mentions: for mention in message.mentions: