feat: add /schedule command for managing scheduled jobs via Telegram#151
Draft
felixeu31 wants to merge 6 commits intoRichardAtCT:mainfrom
Draft
feat: add /schedule command for managing scheduled jobs via Telegram#151felixeu31 wants to merge 6 commits intoRichardAtCT:mainfrom
felixeu31 wants to merge 6 commits intoRichardAtCT:mainfrom
Conversation
added 6 commits
March 15, 2026 10:16
Add "scheduler" key to the bot deps dict and assign the real JobScheduler instance after creation in run_application(), making it accessible to command handlers via context.bot_data["scheduler"].
pause_job() removes job from APScheduler and sets is_active=0. resume_job() re-registers with APScheduler and sets is_active=1. list_jobs() now accepts include_paused flag to show all jobs.
Single /schedule entry point dispatching to subcommands: list, add, remove, pause, resume. Auto-populates chat_id, working_directory, and created_by from Telegram context.
Add /schedule handler to both agentic and classic mode registration, gated on enable_scheduler. Add to get_bot_commands() for Telegram command menu visibility.
16 tests covering all subcommands (list, add, remove, pause, resume), argument parsing edge cases, error handling, and the scheduler-not- available fallback path. 100% coverage on the handler module.
Update command lists in README and CLAUDE.md, expand the Job Scheduler section in docs/setup.md with usage examples, and add CHANGELOG entry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description Add a user-facing
/schedulecommand that allows managing scheduled jobs directly from Telegram chat, removing the needfor direct SQLite access and bot restarts.
Changes - Inject
JobSchedulerinto bot dependencies (exposed fromrun_application())pause_job()andresume_job()methods toJobScheduler, plusinclude_pausedflag onlist_jobs()ScheduleCommandHandlerwith subcommands: -/schedule list— show all jobs (active + paused)/schedule add <name> <min> <hour> <day> <month> <weekday> <prompt>— create a new job/schedule remove <job_id>— soft-delete a job -/schedule pause <job_id>//schedule resume <job_id>— toggleis_active/schedulein both agentic and classic modes, gated onENABLE_SCHEDULER=truechat_id,working_directory, andcreated_byfrom message contextJobScheduler.add_job()— no restart needed - Documentation updated in README, CLAUDE.md, docs/setup.md, and CHANGELOGRelated Issue
Closes #150
Type of Change
Testing
Checklist