🐛 fix(ChatProcess.py): handle error cases when adding reactions and sending error message to improve user experience

This commit is contained in:
2023-09-04 10:57:02 +02:00
parent 62343ea562
commit 7d9323acca

View File

@@ -129,7 +129,12 @@ class Chat:
"name": name,
}
)
else:
try:
await msg.add_reaction("🤬")
except:
pass
async def createThePrompt(self):
self.prompt = createPrompt(
messages=self.context,
@@ -205,10 +210,14 @@ class Chat:
except:
pass
await self.message.channel.send(
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:
f"""An error occured while processing your message, we are sorry about that. Please check your settings and try again later. If the issue persists, please join uor discord server here: https://discord.gg/pB6hXtUeDv and send the following logs:
```
{e}
```""",
delete_after=4,
)
try:
await self.message.add_reaction("😞")
except:
pass
raise e