Skip to content

Support api 10.0, 10.0, 10.2, 10.3 - #65

Merged
Sempai-07 merged 13 commits into
mainfrom
v4
Oct 3, 2026
Merged

Sempai-07 merged 13 commits into
mainfrom
v4

Conversation

@Sempai-07

Copy link
Copy Markdown
Collaborator

4.15.0 - (2026-10-03)

Updates

@Sempai-07 Sempai-07 self-assigned this Oct 3, 2026
@Sempai-07 Sempai-07 added documentation Improvements or additions to documentation idea Suggest an idea think Tse means that the developer will think dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code labels Oct 3, 2026
Comment thread src/structures/message/RichMessage.js Dismissed
…method call'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fa698b55ed

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/client/BaseClient.ts
Comment on lines +383 to +385
.request<MethodsApiReturnType["sendRichMessage"]>(
"sendRichMessage",
toSnakeCase(params),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Serialize rich message media as multipart uploads

When sendRichMessage or sendRichMessageDraft is given a local file/Buffer in richMessage (for example, in a media block), this call passes it under the nested rich_message object. MediaData.hasMedia only recurses into arrays, not nested objects, and rich_message is not JSON-encoded for multipart requests, so the request is sent as JSON and the file cannot be uploaded.

Useful? React with 👍 / 👎.

Comment thread src/rest/MediaData.ts
Comment on lines +284 to +289
if (id === "media" && item.type === "live_photo") {
const photoSource = item.photo?.source ?? item;

if (
!this.isMediaType(photoSource.media) &&
!(await fileExists(photoSource.media))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Attach the static live photo file

For a normal InputMediaLivePhoto, photo is a MediaDataParam, not an object containing source; consequently this expression falls back to the whole item, and the following upload reads photoSource.media (the video) instead of item.photo. Media-group live photos with locally uploaded files therefore attach the video for both media and photo, causing an invalid or incorrect live photo.

Useful? React with 👍 / 👎.

Comment on lines +1728 to +1731
return this.client.deleteEphemeralMessage({
chatId: this.chat.id,
receiverUserId: this.author.id,
ephemeralMessageId: this.ephemeralMessageId,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Target the ephemeral message recipient

For an ephemeral message, author is the sender (from), while the new parser separately stores the API-required recipient as receiverUser. This sends the sender ID as receiver_user_id, so deleting or editing an outgoing ephemeral message normally targets the bot/sender rather than its recipient; the same mistake is repeated in all four ephemeral helper methods.

Useful? React with 👍 / 👎.

Comment on lines +546 to +550
deleteReaction(options = {}) {
return this.client.deleteMessageReaction({
chatId: this.id,
messageId: this.id,
...options,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Require a message ID when deleting reactions from a Chat

Chat.id is the chat identifier, not a message identifier, and this convenience method accepts no message ID. Thus a normal chat.deleteReaction() call sends the chat ID as message_id, which will fail or delete a reaction from an unrelated message if identifiers happen to coincide; expose a target message ID or remove this wrapper.

Useful? React with 👍 / 👎.

Comment thread src/util/Constants.ts
Comment on lines 65 to +68
PurchasedPaidMedia: "purchasedPaidMedia",
ManagedBotUpdated: "managedBotUpdated",
Subscription: "Subscription",
MessageGenerationStopped: "messageGenerationStopped",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Emit subscription updates using the lowercase event name

EventHandlers exposes the new event as subscription, but this constant is capitalized and WorkerClient emits it through Events.Subscription. Consequently listeners registered through the typed public API as client.on("subscription", ...) never run for subscription updates.

Useful? React with 👍 / 👎.

Comment on lines 185 to +189
data: NonNullable<
Update["message"] | Update["channel_post"] | Update["business_message"]
| Update["message"]
| Update["channel_post"]
| Update["business_message"]
| Update["guest_message"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Dispatch guest messages to the guest handler

Adding guest_message to the handler argument type does not make it reachable: processUpdate only enters its message branch for message, channel_post, and business_message, so an update containing only guest_message falls through. Moreover, Events.GuestMessage is mapped to message, so the newly declared guestMessage listener can never receive the guest query.

Useful? React with 👍 / 👎.

Comment on lines +51 to +55
sendRichDraft(richMessage, draftId) {
return this.client.sendRichMessageDraft({
richMessage,
draftId,
chatId: this.chat.id,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reuse the stopped draft ID for rich drafts

MessageGenerationStopped already stores the stopped draft in this.draftId, and sendDraft correctly reuses it, but this equivalent helper requires an unrelated second argument. Calling event.sendRichDraft(richMessage) therefore sends an undefined draft_id and Telegram rejects the request; it should use the stored ID (and, if desired, accept options instead).

Useful? React with 👍 / 👎.

@Sempai-07
Sempai-07 merged commit 0609f38 into main Oct 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation idea Suggest an idea javascript Pull requests that update javascript code think Tse means that the developer will think

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants