🔧 chore(Dockerfile): remove unused TZ environment variable to simplify Dockerfile

🐛 fix(ChatProcess.py): compare message content instead of message id to determine if original message should be added to messages
The TZ environment variable was not being used in the Dockerfile, so it was removed to simplify the file. In the ChatProcess.py file, the comparison of message ids was replaced with a comparison of message content to determine if the original message should be added to the messages list. This ensures that the original message is included in the list even if its id changes.
This commit is contained in:
2023-10-31 13:05:47 +01:00
parent 2fec34a4bd
commit eb89d4ee54
2 changed files with 1 additions and 2 deletions

View File

@@ -5,7 +5,6 @@ ENV PYTHONUNBUFFERED=1
# Turns off pyc files # Turns off pyc files
ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONDONTWRITEBYTECODE=1
ENV TZ=Europe/Paris
# Install pip requirements # Install pip requirements
WORKDIR /Botator WORKDIR /Botator
RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /Botator RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /Botator

View File

@@ -109,7 +109,7 @@ class Chat:
self.message.channel, 10, self.original_message self.message.channel, 10, self.original_message
) )
# if latst item id is not original message id, add original message to messages # if latst item id is not original message id, add original message to messages
if messages[-1].id != self.original_message.id: if messages[-1].content != self.original_message.content:
messages.append(self.original_message) messages.append(self.original_message)
self.context = [] self.context = []
for msg in messages: for msg in messages: