Support Bot API 9.6 types#14
Open
Leask wants to merge 10 commits into
Open
Conversation
- add has_topics_enabled in getMe user - add sendMessageDraft method - update Message topic field wording - widen message_thread_id docs for send methods - update sendChatAction topic wording - mention private chats in topic admin methods - add is_name_implicit topic fields - add getUserGifts and getChatGifts - replace UniqueGiftInfo resale fields - split getBusinessAccountGifts limited filters - add gifted_upgrade origin value - add offer origin value - add message.gift_upgrade_sent service type - add UniqueGift.gift_id - add UniqueGift.is_from_blockchain - add getBusinessAccountGifts blockchain filter - add personal gift quota fields - add premium markers for gifts - add is_upgrade_separate fields - add UniqueGiftColors type - add Gift.has_colors - add UniqueGift.colors - add GiftBackground and Gift.background - add Gift.unique_gift_variant_count - add unique_gift_number fields - add AcceptedGiftTypes.gifts_from_channels - add repostStory method - add UserRating and chat rating field - add ChatFullInfo.paid_message_star_count - add message_effect_id to forward/copy - add ChatFullInfo.unique_gift_colors - add ChecklistTask.completed_by_chat
- update createForumTopic private chat support - add allows_users_to_create_topics - add icon_custom_emoji_id to buttons - add button style field - add ChatOwnerLeft message type - add ChatOwnerChanged message type - add bot profile photo methods - add VideoQuality and video qualities - add ChatFullInfo.first_profile_audio - add UserProfileAudios and getter - add UniqueGiftModel.rarity - add UniqueGift.is_burned
There was a problem hiding this comment.
Pull request overview
Updates @telegraf/types to align with Telegram Bot API 9.6 by adding/adjusting API method typings and the corresponding object/update/message type definitions.
Changes:
- Add Bot API 9.3–9.6 updates, including managed-bot updates and prepared keyboard button support.
- Extend message/model types (e.g., poll option persistence,
date_timeentities, video qualities, tags, gift fields). - Bump published package version and update the README Bot API badge.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
update.ts |
Adds managed_bot update variant to the Update union. |
methods.ts |
Adds/updates Bot API methods and parameter docs for 9.6 (incl. managed bot token methods, profile audios, prepared keyboard button saving, etc.). |
message.ts |
Extends message/service-message unions and message-related objects/entities for 9.6. |
markup.ts |
Adds managed-bot keyboard request button support and prepared keyboard button type. |
manage.ts |
Adds/updates management and chat/user-related types for 9.6 (managed bots, tags, ratings, gifts, etc.). |
README.md |
Updates the Bot API version badge to v9.6. |
package.json |
Bumps package version to 9.6.0. |
package-lock.json |
Aligns lockfile package version to 9.6.0. |
.github/workflows/release.yml |
Reformats workflow steps (not mentioned in PR summary). |
Comments suppressed due to low confidence (1)
message.ts:28
- The JSDoc for
fromlooks detached: there is a “Sender of the message…” comment that isn’t immediately attached to any field, andfromends up undocumented. Consider moving that comment to thefromproperty.
/** Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only */
message_thread_id?: number;
/** Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. */
/** Information about the direct messages chat topic that contains the message */
direct_messages_topic?: DirectMessagesTopic;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| pinned_message?: Message; | ||
| /** Information about types of gifts that are accepted by the chat or by the corresponding user for private chats */ | ||
| accepted_gift_types?: AcceptedGiftTypes[]; | ||
| /** The number of Telegram Stars a general user have to pay to send a message to the chat */ |
| permissions?: ChatPermissions; | ||
| /** Information about types of gifts that are accepted by the chat or by the corresponding user for private chats */ | ||
| accepted_gift_types?: AcceptedGiftTypes[]; | ||
| /** The number of Telegram Stars a general user have to pay to send a message to the chat */ |
| permissions?: ChatPermissions; | ||
| /** Information about types of gifts that are accepted by the chat or by the corresponding user for private chats */ | ||
| accepted_gift_types?: AcceptedGiftTypes[]; | ||
| /** The number of Telegram Stars a general user have to pay to send a message to the chat */ |
| pinned_message?: Message; | ||
| /** Information about types of gifts that are accepted by the chat or by the corresponding user for private chats */ | ||
| accepted_gift_types?: AcceptedGiftTypes[]; | ||
| /** The number of Telegram Stars a general user have to pay to send a message to the chat */ |
Comment on lines
231
to
236
| /** Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success. */ | ||
| copyMessage(args: { | ||
| /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */ | ||
| chat_id: number | string; | ||
| /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */ | ||
| /** Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only */ | ||
| message_thread_id?: number; |
Comment on lines
273
to
278
| /** Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned. */ | ||
| copyMessages(args: { | ||
| /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */ | ||
| chat_id: number | string; | ||
| /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */ | ||
| /** Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only */ | ||
| message_thread_id?: number; |
Comment on lines
+13
to
+21
| - uses: actions/checkout@v3 | ||
| - run: npm ci --ignore-scripts | ||
| - run: npm run prepare | ||
| - name: Publish to npm | ||
| run: | | ||
| npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN} | ||
| npm publish --ignore-scripts --access=public | ||
| env: | ||
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
Comment on lines
+719
to
+725
| export interface DateTime extends Abstract { | ||
| type: "date_time"; | ||
| /** Unix time associated with the entity */ | ||
| unix_time?: number; | ||
| /** String that defines the formatting of the date and time */ | ||
| date_time_format?: string; | ||
| } |
This was referenced May 5, 2026
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
Validation
deno fmt --check manage.ts markup.ts message.ts methods.ts update.tsdeno lintdeno task checknpm pack --dry-runNotes
.github/workflows/release.ymlis formatted so full-repodeno fmt --checkpasses.