Skip to content

feat(telegram): align global commands with send-only vision#605

Merged
cryptodj413 merged 1 commit intoblinklabs-io:mainfrom
cryptodj413:feat/telegram-global-commands
Feb 6, 2026
Merged

feat(telegram): align global commands with send-only vision#605
cryptodj413 merged 1 commit intoblinklabs-io:mainfrom
cryptodj413:feat/telegram-global-commands

Conversation

@cryptodj413
Copy link
Copy Markdown
Contributor

@cryptodj413 cryptodj413 commented Feb 3, 2026

Closes #492
Closes #493
Closes #494


Summary by cubic

Add Telegram global commands (/start, /help, /settings) with long polling, replying only in the configured chat to keep the bot send-only. Closes #492, #493, #494.

  • New Features

    • Set global commands via SetMyCommands.
    • Handle /start, /help, /settings with simple replies; ignore other messages and other chats.
  • Refactors

    • Start long polling with a default handler and allow only message updates.
    • Add pollCancel and cancel on Start/Stop to prevent double-start and ensure clean shutdown.

Written for commit d4bb6c9. Summary will update on new commits.

Summary by CodeRabbit

Release Notes

  • New Features
    • Telegram bot now responds to /start, /help, and /settings commands with proper handling and error logging.
    • Enhanced bot initialization and lifecycle management for improved stability and command responsiveness.

Signed-off-by: cryptodj413 <shinjirohara2@gmail.com>
@cryptodj413 cryptodj413 requested a review from a team as a code owner February 3, 2026 03:29
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

The change adds command handling to the Telegram bot integration. A commandHandler function was created to process /start, /help, and /settings commands, with optional chat-specific filtering. The TelegramOutput struct adds a pollCancel field to manage the long-polling lifecycle. The bot now registers global commands during initialization and starts a polling goroutine. The Start method initializes polling and sets global commands while guarding against double-start. The Stop method cancels active polling before shutdown. Error logging was added for command registration failures.

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR addresses issue #492 (global commands) by implementing /start, /help, /settings handlers. However, issue #493 (subscribe/unsubscribe commands) is not implemented in the code changes shown. Add subscribe and unsubscribe command handlers to fully address issue #493's requirement for user interaction commands.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly relates to the main change: implementing Telegram global commands handling, which aligns with the PR's primary objective.
Out of Scope Changes check ✅ Passed All changes are scoped to Telegram global command handling and long-polling lifecycle management, which aligns with linked issues #492 and #493.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@cryptodj413 cryptodj413 self-assigned this Feb 3, 2026
@cryptodj413 cryptodj413 requested review from wolf31o2 and removed request for a team February 3, 2026 03:35
@cryptodj413 cryptodj413 merged commit f08fc0c into blinklabs-io:main Feb 6, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Telegram send message Telegram subscribe/unsubscribe commands Telegram global commands

2 participants