Skip to content

Telegram /subscribe self-service for LDS bot#175

Draft
TaprootFreak wants to merge 1 commit intodevelopfrom
feat/telegram-subscribe-pattern
Draft

Telegram /subscribe self-service for LDS bot#175
TaprootFreak wants to merge 1 commit intodevelopfrom
feat/telegram-subscribe-pattern

Conversation

@TaprootFreak
Copy link
Copy Markdown
Contributor

Summary

Replace hardcoded TELEGRAM_CHAT_ID with /subscribe self-service. Aligns LDS with the same telegram delivery pattern as the d-EURO, JuiceDollar and RangeKeeper bots.

  • Adds node-telegram-bot-api with polling.
  • /start / /subscribe / /unsubscribe / /help commands.
  • groups.json persisted at TELEGRAM_GROUPS_JSON (Azure Files mount in production).
  • sendMessage iterates every subscriber, per-chat failures logged-and-skipped.

Test plan

  • npm run build clean
  • After Azure App Service deploy: /start subscribes
  • Notify path delivers to every subscriber

Aligns LDS with the same self-service /subscribe pattern that the
d-EURO and JuiceDollar bots use plus DFXswiss/rangekeeper: each
operator opens a private chat with the bot, sends /start (or
/subscribe), and is appended to a persisted subscriber list.
/unsubscribe removes them; /help lists the commands.

- Adds node-telegram-bot-api with polling and replaces the existing
  fetch-only flow.
- Replaces TELEGRAM_CHAT_ID env-var with TELEGRAM_GROUPS_JSON pointing
  at the persisted subscribers file (Azure Files mount in production).
- sendMessage iterates over every subscriber sequentially; per-chat
  failures are logged and skipped, returns true iff at least one
  delivery succeeded.
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.

1 participant