🐛 fix(ChatProcess.py): handle exceptions and send error message with logs to the user when an error occurs during message processing

🐛 fix(channelSetup.py): format code to improve readability and adhere to PEP 8 style guide
🐛 fix(makeprompt.py): fix spacing issue in if statement
🐛 fix(openaicaller.py): format code to improve readability and adhere to PEP 8 style guide
This commit is contained in:
2023-09-01 11:20:29 +02:00
parent d60102c0fd
commit f896001305
4 changed files with 24 additions and 13 deletions

View File

@@ -189,8 +189,17 @@ class Chat:
return
if await self.postExitCriteria():
return
await self.message.channel.trigger_typing()
await self.formatContext()
await self.createThePrompt()
await self.getResponse()
await self.processResponse()
try:
await self.message.channel.trigger_typing()
await self.formatContext()
await self.createThePrompt()
await self.getResponse()
await self.processResponse()
except Exception as e:
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:
```
{e}
```"""
)
raise e