Skip to content

WIP: feat(types): partial Bot API 10.1 support (Rich Messages, Drafts, etc.)#4

Draft
siakinnik wants to merge 6 commits into
telegraf-hardened:masterfrom
siakinnik:bot-api-10.1-sync
Draft

WIP: feat(types): partial Bot API 10.1 support (Rich Messages, Drafts, etc.)#4
siakinnik wants to merge 6 commits into
telegraf-hardened:masterfrom
siakinnik:bot-api-10.1-sync

Conversation

@siakinnik

@siakinnik siakinnik commented Jun 14, 2026

Copy link
Copy Markdown
Member

Summary

Draft PR for tracking Bot API 10.1 types implementation. Added core structures for Rich Messages and message streaming.

Todo:

  • Rich Message structures and text blocks
  • fix date_time entity updates (MessageEntity)
  • update sendMessageDraft method
  • Complete Guest Mode types (guest_message, answerGuestQuery)
  • Add remaining 10.x features (Giveaways, etc.)

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces rich message structures, live photo support, and guest bot caller fields to the message types, alongside updating sendMessageDraft to support rich messages and making its text parameter optional. The feedback suggests removing a Russian comment, deleting commented-out code blocks, and removing a redundant duplicate entry of MessageEntity.DateTime in the MessageEntity union type.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread message.ts Outdated
Comment thread message.ts
Comment on lines +782 to +785
// /** Optional. For 'date_time' entities, target Unix timestamp */
// unix_time?: number;
// /** Optional. For 'date_time' entities, the format string to display the date/time */
// date_time_format?: string;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Please avoid leaving commented-out code in the pull request. If these fields are no longer needed or are implemented elsewhere, they should be removed entirely.

Comment thread message.ts Outdated
siakinnik and others added 2 commits June 14, 2026 11:58
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@siakinnik siakinnik marked this pull request as draft June 14, 2026 09:59
siakinnik and others added 3 commits June 24, 2026 22:36
Rewrite the Rich Message types against the official Bot API spec, replacing
the invented shapes from the initial 10.1 port:

- RichText is the union itself (string | RichText[] | RichText*), not a
  wrapper with text_pieces
- Fix discriminators: heading, pre, blockquote, pullquote
- Fix fields: RichTextDateTime.unix_time/date_time_format,
  RichTextTextMention.user, RichTextCustomEmoji.alternative_text,
  email_address, RichBlockMap.location/zoom/width/height,
  RichBlockTable.cells, RichBlockDetails.summary/blocks, list items
- Received media blocks (animation/audio/photo/video/voice_note/thinking)
  carry received media objects, not InputMedia
- Add missing rich text types (phone_number, bank_card_number, mention,
  hashtag, cashtag, bot_command, anchor(_link), reference(_link))
- Drop spurious <F> generic from CommonMessage/rich_message; add
  RichMessageMessage subtype and wire into CommonMessageBundle
- Fix reply_to_checklist_task_id regression (string -> number)

methods.ts:
- Fix sendMessageDraft indentation; remove invented rich_message param;
  text optional 0-4096 with Thinking placeholder
- Add sendRichMessage, sendRichMessageDraft and InputRichMessage

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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