feat(telegram): parse stickers and animations - #835
Open
grootbro wants to merge 3 commits into
Open
Conversation
Thread.reply() threw NotImplementedError on Telegram because the adapter had no reply method, even though the Bot API threads an answer to its question with reply_parameters. postMessage takes an optional reply target and passes it to every send path — text, rich messages, documents, attachments and both media group variants — and reply() delegates to it, matching how the WhatsApp adapter implements the same contract. The target is decoded through the existing decodeCompositeMessageId, so a target from another chat is rejected the same way an edit would be. allow_sending_without_reply is set so a deleted target degrades to an unthreaded message instead of failing the send. Signed-off-by: grootbro <vadim@ravefox.dev>
In a group a Telegram bot only sees messages that address it, and users address a bot by replying to it as often as by typing its handle. The adapter reported isMention for the handle but not for the reply, so a bot went quiet the moment the conversation moved to replies. mentionOnReply turns that on. It is off by default: the flag changes which messages report isMention, and a bot that deliberately answers only explicit mentions should keep the stricter behaviour. It also reads from TELEGRAM_MENTION_ON_REPLY so a deployment can set it without code. The check runs before the empty-text guard, so a reply carrying only a photo or a document counts too. Signed-off-by: grootbro <vadim@ravefox.dev>
A sticker carries no text, so it reached the handler as an empty message and looked like a delivery that had lost its body. An animation — the MP4 Telegram sends for a GIF — was not declared on the message type and was dropped on the floor. A sticker now reports the emoji it stands for as the message text, plus an image attachment typed by its real format: WebP for a still one, WebM for a video sticker, TGS for a Lottie one. An animation arrives as a video attachment alongside the other media types. Signed-off-by: grootbro <vadim@ravefox.dev>
Contributor
|
@grootbro is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
Comment on lines
+2526
to
+2532
| const urlReplyParameters = this.buildReplyParameters( | ||
| replyToMessageId, | ||
| thread.chatId | ||
| ); | ||
| if (urlReplyParameters) { | ||
| payload.reply_parameters = urlReplyParameters; | ||
| } |
Contributor
There was a problem hiding this comment.
Suggested change
| const urlReplyParameters = this.buildReplyParameters( | |
| replyToMessageId, | |
| thread.chatId | |
| ); | |
| if (urlReplyParameters) { | |
| payload.reply_parameters = urlReplyParameters; | |
| } | |
| } | |
| const urlReplyParameters = this.buildReplyParameters( | |
| replyToMessageId, | |
| thread.chatId | |
| ); | |
| if (urlReplyParameters) { | |
| payload.reply_parameters = urlReplyParameters; |
URL-based attachment path in sendAttachmentMessage only sets reply_parameters when replyMarkup is present, dropping native reply threading for URL attachments without buttons
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.
Based on #834.
A sticker carries no text, so it reached the handler as an empty message and looked like a delivery that had lost its body. An animation — the MP4 Telegram sends for a GIF — was not declared on the message type and was dropped on the floor.
A sticker now reports the emoji it stands for as the message text, plus an image attachment typed by its real format: WebP for a still one, WebM for a video sticker, TGS for a Lottie one. An animation arrives as a video attachment alongside the other media types.