-
Notifications
You must be signed in to change notification settings - Fork 8
feat: Add /stop and /start commands for telegram bot (Issue #1081) #1111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #1081
Create telegram-start-stop-command.lib.mjs module with: - Per-chat stop state management using Map - isChatStopped() and setChatStopped() for state control - getChatStopInfo() and getStoppedChats() for status queries - Owner-only access control (creator, not admins) - Graceful stop: existing queue items continue to process This is the core module for issue #1081. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changes to telegram-bot.mjs: - Import isChatStopped and getChatStopInfo from new module - Add stop check to /solve command (rejects if chat stopped) - Add stop check to /hive command (rejects if chat stopped) - Register start/stop commands from new module - Update /help to show stopped status when applicable - Add /stop and /start to help command list Fixes #1081 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add test-start-stop-command.mjs to experiments folder with tests for: - Initial state (no chats stopped) - Stopping a chat - Getting stop info - Per-chat isolation - Getting all stopped chats - Starting (un-stopping) a chat - Multiple chats can be stopped independently Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Format telegram-start-stop-command.lib.mjs with prettier - Compact command registration in telegram-bot.mjs to stay under 1500 lines - telegram-bot.mjs now at 1487 lines (was 1502) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This reverts commit 543d74e.
|
|
Resolve conflicts, and add optional reason support for /stop command (any text after the command |
|
🤖 AI Work Session Started Starting automated work session at 2026-01-19T22:17:36.170Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
- Add reason parameter to setChatStopped() function - Parse reason text from /stop command (text after "/stop ") - Display reason in /solve and /hive rejection messages - Display reason in /help stopped status section - Display reason when /stop is called on already-stopped chat - Add tests for reason functionality (tests 10-13) Resolves conflict with main branch by merging accept_invites command. Fixes #1081 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…count - Add getStoppedChatRejectMessage() helper to start-stop module - Use helper in /solve and /hive handlers to reduce code duplication - Simplify verbose logging with VERBOSE && console.log() pattern - Reduce telegram-bot.mjs from 1534 to 1488 lines (under 1500 limit) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
✅ ResolvedI've addressed all the feedback from the latest comments: Merge conflicts resolved
Optional reason support for
|
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
Summary
Add
/stopand/startcommands for the Telegram bot that allow chat owners to control whether the bot accepts new tasks in their chat.Key features:
/stopcommand puts the bot in read-only mode for the chat (owner only)/stop <reason>- Optional reason text that will be shown in rejection messages/startcommand resumes accepting tasks (owner only)/solveand/hiveare rejected with a clear message (including reason if provided)/help,/limits,/version) remain availableImplementation Details
New module:
src/telegram-start-stop-command.lib.mjsMap<chatId, StopInfo>StopInfoincludes:stoppedAt,stoppedBy, and optionalreasonisChatStopped(),setChatStopped(),getChatStopInfo(),getStoppedChats()/topcommandChanges to
telegram-bot.mjs:isChatStoppedcheck in/solveand/hivehandlers/startand/stopcommands from the new module/helpto show stopped status (with reason) and document new commandsTest script:
experiments/test-start-stop-command.mjsTest Plan
npm run test)node experiments/test-start-stop-command.mjs)npm run lint)npm run format:check)/stop/stop Maintenanceshows reason in confirmation/solveand/hiverejected when stopped (with reason displayed)/helpshows stopped status with reason/start/startFixes #1081
🤖 Generated with Claude Code