🐛 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

@@ -43,9 +43,9 @@ async def fetch_messages_history(channel: discord.TextChannel, limit, original_m
async for msg in channel.history(limit=100, before=original_message):
if not is_ignorable(msg.content):
messages.append(msg)
if len(messages) == limit-1:
if len(messages) == limit - 1:
break
messages.append(original_message)
messages.reverse()
return messages