Skip to content

Commit 018f745

Browse files
committed
patches for the notification system
1 parent 6d989de commit 018f745

File tree

4 files changed

+23
-9
lines changed

4 files changed

+23
-9
lines changed

config/config.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ MaxAlertsPerUser = 100
195195
PollingIntervalSeconds = 5
196196

197197
# How many old/past reminders to list
198-
ShowPastRemindersCount = 5
198+
ShowPastRemindersCount = 10
199199

200200
# ~~~~~~~~~~~~~~~
201201
# Perplexity API

src/custom_functions.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,12 @@ async def observe_chat():
172172
manage_reminder_function = {
173173
'name': 'manage_reminder',
174174
'description': """Manages user reminders (alerts); use if the user requests alerts, a timed notification, etc (hälytys, muistutus, ajastettu viesti..) Specify the action: 'add' to create, 'view' to list pending, 'delete' to remove by ID, or 'edit' to modify by ID.
175-
If you're unsure of the user's time zone, ask it first, and set the UTC alert accordingly. For instance, Finland is UTC+2 in winter and UTC+3 during summertime. Add the reminder in the user's own language! Suomeksi, jos käyttäjä puhuu suomea! Always ask the user's timezone if unsure.
176-
- For 'add': requires 'reminder_text' and exact 'due_time_utc' (ISO 8601 format, e.g., '2025-04-04T10:00:00Z'). Calculate UTC from user input based on current system UTC time. Notifications can be up to around 4000 characters or more.
175+
If you're unsure of the user's time zone, ask it first, and set the UTC alert accordingly.
176+
For instance, Finland is UTC+2 in winter and UTC+3 during summertime. Add the reminder in the user's own language!
177+
Lisää entry suomeksi, jos _käyttäjä_ puhuu suomea, englanniksi jos englantia.
178+
Use the user's own language.
179+
Always ask the user's timezone before adding the entry if unsure.
180+
- For 'add': requires 'reminder_text' and exact 'due_time_utc' (ISO 8601 format, e.g., '2025-04-04T10:00:00Z'). Calculate UTC from user input based on current system UTC time. Notifications can be up to around 4000 characters or more; is automatically split when sending.
177181
- For 'view': no other parameters needed.
178182
- For 'delete': requires 'reminder_id'.
179183
- For 'edit': requires 'reminder_id' and at least one of 'reminder_text' or 'due_time_utc'.""",

src/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99
#
1010
# version of this program
11-
version_number = "0.7611"
11+
version_number = "0.7612"
1212

1313
# Add the project root directory to Python's path
1414
import sys

src/text_message_handler.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,11 +1210,21 @@ async def handle_message(bot, update: Update, context: CallbackContext, logger)
12101210
message=final_reply,
12111211
source='manage_reminder'
12121212
)
1213-
await context.bot.send_message(
1214-
chat_id=chat_id,
1215-
text=final_reply,
1216-
parse_mode=ParseMode.HTML
1217-
)
1213+
1214+
message_parts = split_message(final_reply, max_length=4000)
1215+
1216+
for part in message_parts:
1217+
await context.bot.send_message(
1218+
chat_id=chat_id,
1219+
text=part,
1220+
parse_mode=ParseMode.HTML
1221+
)
1222+
1223+
# await context.bot.send_message(
1224+
# chat_id=chat_id,
1225+
# text=final_reply,
1226+
# parse_mode=ParseMode.HTML
1227+
# )
12181228

12191229
stop_typing_event.set()
12201230
return

0 commit comments

Comments
 (0)