Add firehose command for real-time message streaming#1
Open
serefyarar wants to merge 4 commits intoskillhq:mainfrom
Open
Add firehose command for real-time message streaming#1serefyarar wants to merge 4 commits intoskillhq:mainfrom
serefyarar wants to merge 4 commits intoskillhq:mainfrom
Conversation
Adds a long-running `telegram firehose` command that uses GramJS NewMessage events to stream incoming messages as NDJSON to stdout. Supports --chat filter and --include-outgoing flag. Exports resolveChat/getChatTitle from client.ts for reuse. Made-with: Cursor
GramJS NewMessage chats filter expects numeric IDs, not entity objects. Made-with: Cursor
- Remove --since from firehose, keep it as pure live stream - Make read chat argument optional; when omitted with --since, reads from all active chats with throttling and rate-limit handling Made-with: Cursor
Each message is now one JSON line instead of a single pretty-printed blob. Includes chatId/chatTitle in each line for all-chats mode. Made-with: Cursor
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.
Summary
telegram firehosecommand that streams incoming Telegram messages in real-time as NDJSON (one JSON object per line) to stdout, using GramJSNewMessageevent handler.--chat <name|@user|id>to filter to a single chat, and--include-outgoingto include your own messages.resolveChat,getChatTitle, andResolvedEntityfromclient.tsfor reuse across commands.Usage
Each line is a JSON object with:
id,date,chatId,chatTitle,sender,senderId,text,replyToMsgId,isOutgoing.Test plan
telegram firehoseand verify NDJSON lines appear for incoming messages--chat "SomeChat"and verify only that chat's messages appear--include-outgoingand verify own messages are includedtscbuilds without errorsMade with Cursor