Skip to content

Commit b04b398

Browse files
committed
v0.761 - timed notifications & alerts
1 parent 5b9d907 commit b04b398

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

config/config.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ EnableHolidayNotification = true
188188
# Enable or disable the reminder/alert functionality
189189
EnableReminders = True
190190

191-
# Maximum number of pending reminders per user
192-
MaxAlertsPerUser = 30
191+
# Maximum number of pending reminders per user; set to 0 for unlimited
192+
MaxAlertsPerUser = 100
193193

194194
# How often (in seconds) the bot checks for due reminders
195195
PollingIntervalSeconds = 5

src/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,12 @@ def run(self):
443443

444444
# Register command handlers from bot_commands module
445445
application.add_handler(
446-
CommandHandler("about", partial(bot_commands.about_command, version_number=self.version_number))
446+
CommandHandler(
447+
["about", "info"], # <--- list of commands
448+
partial(bot_commands.about_command, version_number=self.version_number)
449+
)
447450
)
451+
448452
application.add_handler(
449453
CommandHandler(
450454
"help",

src/reminder_handler.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ async def handle_add_reminder(user_id, chat_id, reminder_text, due_time_utc_str)
4848

4949
# 3) Check user's current reminder count
5050
current_count = db_utils.count_pending_reminders_for_user(REMINDERS_DB_PATH, user_id)
51-
if current_count >= MAX_ALERTS_PER_USER:
51+
52+
# Only enforce the limit if it's > 0
53+
if MAX_ALERTS_PER_USER > 0 and current_count >= MAX_ALERTS_PER_USER:
5254
logger.info(f"User {user_id} has {current_count} reminders; reached max of {MAX_ALERTS_PER_USER}.")
5355
return f"You already have {current_count} pending reminders. The maximum is {MAX_ALERTS_PER_USER}."
5456

0 commit comments

Comments
 (0)