Skip to content

Commit 0333ed4

Browse files
committed
v0.7613 - timestamping to system msgs
1 parent 71d375f commit 0333ed4

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ If you run into any issues, consult the logs or reach out on the repository's [I
240240
---
241241

242242
# Changelog
243+
- v0.7613 - Improved timestamps on multiple timezones
244+
- Added a separate module to `src/timedate_handler.py` to assist the model
245+
- => Datetime stamps now in separate system messages
246+
- => More TZ-aware dates and times
243247
- v0.7611 - Parsing hotfix for notifications
244248
- v0.761 - **Timed notifications / user reminders**
245249
- Brand-new feature: users can set timed reminders (alerts) by requesting reminders that the bot stores in an SQLite database. A separate poller picks them up as soon as they are due, and the bot automatically notifies the user on set times.

src/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,10 @@ def load_config(self):
213213
'SystemInstructions',
214214
'You are an OpenAI API-based chatbot on Telegram.'
215215
)
216-
self.system_instructions = f"[Bot's current model: {self.model}] {default_system_msg}"
216+
217+
# # // skip current model info
218+
# self.system_instructions = f"[Bot's current model: {self.model}] {default_system_msg}"
219+
self.system_instructions = f"[Instructions] {default_system_msg}"
217220

218221
self.start_command_response = self.config.get(
219222
'StartCommandResponse',

src/text_message_handler.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import json
1616
import asyncio
1717
import openai
18-
from datetime import datetime, timezone
1918

2019
import utils
2120
from utils import holiday_replacements
@@ -150,9 +149,8 @@ def pick_model_auto_switch(bot):
150149
if not DB_INITIALIZED_SUCCESSFULLY or not DB_PATH:
151150
logging.warning("DB not initialized or path missing — can't auto-switch, fallback to default model.")
152151
return True
153-
# // old method
154-
# usage_date = datetime.datetime.utcnow().strftime('%Y-%m-%d')
155-
usage_date = datetime.now(timezone.utc).strftime('%Y-%m-%d')
152+
153+
usage_date = datetime.datetime.utcnow().strftime('%Y-%m-%d')
156154
daily_usage = _get_daily_usage_sync(DB_PATH, usage_date)
157155
if not daily_usage:
158156
daily_premium_tokens, daily_fallback_tokens = (0, 0)
@@ -1355,12 +1353,6 @@ async def handle_message(bot, update: Update, context: CallbackContext, logger)
13551353
model_info=model_info
13561354
)
13571355

1358-
# # Log the bot's response
1359-
# bot.log_message(
1360-
# message_type='Bot',
1361-
# message=bot_reply,
1362-
# )
1363-
13641356
# # # send the response
13651357
# # await context.bot.send_message(
13661358
# # chat_id=chat_id,

0 commit comments

Comments
 (0)