From 7d9323accae49ce5c81303deee68cd434d1a5786 Mon Sep 17 00:00:00 2001 From: Paillat Date: Mon, 4 Sep 2023 10:57:02 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(ChatProcess.py):=20handle=20?= =?UTF-8?q?error=20cases=20when=20adding=20reactions=20and=20sending=20err?= =?UTF-8?q?or=20message=20to=20improve=20user=20experience?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ChatProcess.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ChatProcess.py b/src/ChatProcess.py index 75bada8..d6204cc 100644 --- a/src/ChatProcess.py +++ b/src/ChatProcess.py @@ -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