Skip to content

feat(channels): add mark-read support and channel listing with unread counts#17

Open
AlexanderMakarov wants to merge 4 commits intokfastov:mainfrom
AlexanderMakarov:feature/dump-channels-and-work-with-read-mark
Open

feat(channels): add mark-read support and channel listing with unread counts#17
AlexanderMakarov wants to merge 4 commits intokfastov:mainfrom
AlexanderMakarov:feature/dump-channels-and-work-with-read-mark

Conversation

@AlexanderMakarov
Copy link

Add the ability to mark Telegram channels/chats as read and list channels with their unread message counts.

Changes:

  • telegram-client.js: adds markChannelRead(channelId) method that calls ReadHistory to mark all messages in a channel as read
  • mcp-server.js: exposes markChannelRead as an MCP tool, accepting a channelId string argument
  • cli.js:
    • channels list now includes an unreadCount field in the output, making it easy to identify chats with unread messages
    • channels mark-read <channelId> command marks a specific channel as read
    • messages list gains an --offset-id option for pagination, useful when fetching messages around a specific message ID

These additions allow automation and AI assistants to programmatically manage read state in Telegram, which is useful for notification pipelines and inbox-zero workflows.

Adds --offset-id CLI flag and corresponding offsetId support in
TelegramClient.getMessagesByChannelId(), allowing callers to fetch
messages older than a given message ID. Useful for paginating through
large channels without re-fetching already-seen messages.
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