worldmonitor icon indicating copy to clipboard operation
worldmonitor copied to clipboard

user-defined channel watchlist — add any public Telegram channel by @username

Open ayad318 opened this issue 8 months ago • 6 comments

Feature area

News panels / RSS feeds

Description

A @username input field in the Telegram Intel panel that lets users add any public Telegram channel to a personal watchlist, persisted in localStorage. The user types a username, sees a preview (channel title + member count), then clicks Add. Their saved channels appear as removable pills and their posts render alongside the curated feed.

No user login to Telegram required. The relay's existing authenticated GramJS session already has permission to read any public channel — this only needs two new GET routes on the relay and ~170 lines of frontend/service code.

User flow:

  1. User types @ukraine_news in a new input in the panel
  2. Frontend debounces 800ms → calls GET /telegram/resolve?username=ukraine_news
  3. Relay resolves via client.getEntity() → returns title + member count, cached in Redis 24h
  4. Panel shows: "Ukraine News · 89k members [+ Add]"
  5. User clicks Add → saved to localStorage under telegram:watchlist:v1
  6. Panel calls GET /telegram/channel?username=ukraine_news&limit=20
  7. Relay fetches via client.getMessages(), cached 60s (same TTL as curated feed)
  8. Posts appear with a removable pill tag

Problem it solves

The Telegram Intel panel is currently locked to the 26 curated OSINT channels hardcoded in the Railway relay.

This is especially limiting for:

  • Anyone who wants a specific telegram channel to look from
  • Researchers and analysts who follow known channels not in the curated list
  • Users outside the Middle East / Ukraine focus who want locally relevant OSINT channels

Alternatives considered

  • Telegram Login Widget: only provides user identity, not a channel-reading session. Adds per-user session storage complexity with no benefit since the relay session already covers public channels.
  • contacts.search keyword search: possible but Telegram rate-limits this aggressively. Better as a follow-up once username-based lookup is stable.
  • Expanding the hardcoded 26: doesn't scale and requires a relay redeploy for every user request.

Additional context

No response

ayad318 avatar Mar 21 '26 12:03 ayad318

Can I work on this enhancement if we are adding this feature ??

R0h1tAnand avatar Mar 25 '26 05:03 R0h1tAnand

Good news — PR #2262 from @lspassos1 implements this feature (custom Telegram channel watchlists). It's been approved and is ready to merge. Once it lands, this issue is resolved.

@ayad318 @R0h1tAnand — heads up that a working implementation is already in review.

SebastienMelki avatar Mar 30 '26 20:03 SebastienMelki

@SebastienMelki Thanks

ayad318 avatar Mar 31 '26 01:03 ayad318

"Great to hear! Thanks for the heads-up, looking forward to it being merged."

On Mon, Mar 30, 2026, 8:41 PM Ayad Farhat @.***> wrote:

ayad318 left a comment (koala73/worldmonitor#1994) https://github.com/koala73/worldmonitor/issues/1994#issuecomment-4159229098

@SebastienMelki https://github.com/SebastienMelki Thanks

— Reply to this email directly, view it on GitHub https://github.com/koala73/worldmonitor/issues/1994?email_source=notifications&email_token=CAXZCSSNDQCI5GODOJLIBS34TMO3TA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMJVHEZDEOJQHE4KM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#issuecomment-4159229098, or unsubscribe https://github.com/notifications/unsubscribe-auth/CAXZCSRTSRYPPMACTV7A3M34TMO3TAVCNFSM6AAAAACW2ASCOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DCNJZGIZDSMBZHA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jaspercross1231-del avatar Mar 31 '26 11:03 jaspercross1231-del

Status: partially addressed — keeping open for the Telegram-specific part.

What shipped: a user-defined live-channel watchlist that persists across reloads (src/live-channels-window.ts — parseYouTubeInput() + saveChannelsToStorage()). Today it supports YouTube channels/handles and HLS (.m3u8) stream URLs.

Still open (this issue): arbitrary public Telegram channels by @username. That needs a different ingestion path than YouTube/HLS.

Next steps when we pick this up:

  1. Add a Telegram reader in the relay (t.me/s/<channel> public preview HTML, or Bot API) → normalize into the live-channel item shape.
  2. Generalize parseYouTubeInput() → parseChannelInput() recognizing t.me/<handle> / @tg:<handle>.
  3. Persist alongside the existing watchlist; respect the per-user channel cap + add basic rate-limit/safelist to avoid abuse.

Thanks @ayad318 — the watchlist scaffolding is done, so this is now a scoped addition rather than a from-scratch build.

koala73 avatar Jun 11 '26 13:06 koala73

Agent-ready AC for PR #2262 (do not start a parallel watchlist):

  • [ ] Resolve public @username via the existing GramJS session (GET /telegram/resolve)
  • [ ] Fetch recent posts (GET /telegram/channel) with the same cache TTL as the curated feed
  • [ ] Persist watchlist in localStorage key telegram:watchlist:v1, removable pills
  • [ ] Cap the list; public channels only
  • [ ] Out of scope: Telegram Login Widget, private channels, contacts.search, expanding the hardcoded curated pack

Relay file pointers remain scripts/ais-relay.cjs (loadTelegramChannels ~924). User-defined ≠ product-managed (#6654 X registry is the X analogue of the curated pack, not of this).

koala73 avatar Aug 13 '26 19:08 koala73