🐛 fix(ChatProcess.py): remove "🤔" reaction after processing the message to improve user experience

🐛 fix(ChatProcess.py): handle error when removing "🤔" reaction in case it was already removed
🐛 fix(ChatProcess.py): improve error message when an error occurs during message processing
🐛 fix(ChatProcess.py): set delete_after parameter to 4 seconds for error message to automatically delete after a short period
🐛 fix(cogs/chat.py): fix typo in message.channel.send() method call
This commit is contained in:
2023-09-04 10:51:11 +02:00
parent e264d5f654
commit 62343ea562
2 changed files with 10 additions and 3 deletions

View File

@@ -193,15 +193,22 @@ class Chat:
return
try:
await self.message.channel.trigger_typing()
await self.message.add_reaction("🤔")
await self.formatContext()
await self.createThePrompt()
await self.getResponse()
await self.processResponse()
await self.message.remove_reaction("🤔", self.message.guild.me)
except Exception as e:
try:
self.message.remove_reaction("🤔", self.message.guild.me)
except:
pass
await self.message.channel.send(
f"""An error occured while processing your message. Please check your settings and try again. If the issue persists, please join uor discord server here: https://discord.gg/pB6hXtUeDv and send the following logs:
f"""An error occured while processing your message, we are sorry about that. Please check your settings and try again. If the issue persists, please join uor discord server here: https://discord.gg/pB6hXtUeDv and send the following logs:
```
{e}
```"""
```""",
delete_after=4,
)
raise e