error handling in joke response
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user