Repository navigation
v0.2.0-alpha.3
Pre-release
Pre-release
·
1 commit
to main
since this release
Inline answers of files Telegram already has, edits of inline messages,
drafts with Stop, and a cover on a video. A bot that passes a callback's
message on as a value no longer compiles: see Breaking.
Added
- Video cover and start.
VideoOptionsgainedCover, the picture
clients show before the video plays,StartTimestampand
ShowCaptionAboveMedia. A cover is a file_id, a URL, a path on a
self-hosted server or an upload; an upload goes as a part of its own,
named by anattach://reference, so a video and its cover travel in one
sendVideo. - Send options.
CaptionOptionsgainedDisableNotification,
ProtectContentandMessageEffectID, so every captioned send (photo,
video, animation, audio, document, ephemeral or not) can go silently,
protected, or with an effect, without a new method. Text sends still have
none;docs/limitations.mdsays so. - Cached inline results and the results button.
InlineQueryResultCachedPhoto,InlineQueryResultCachedVideoand
InlineQueryResultCachedMpeg4Gifsend a file Telegram already has by its
file_id, so an inline answer of past results fetches nothing.
InlineAnswer.Buttonputs a button above the results that opens a Mini App
or sends/startwith a parameter. A button Telegram would refuse, and a
cached video without the title Telegram requires, are refused before
anything is sent. - Edits of an inline message.
EditInlineMessageText,
EditInlineMessageMedia,EditInlineMessageCaptionand
EditInlineMessageReplyMarkupaddress a message sent through the bot by
itsinline_message_id. "Not modified" is success for all four. Telegram
takes no upload in an inline edit, soEditInlineMessageMediarefuses one
before sending. - Drafts with Stop.
SendMessageDraft,SendRichDraftHTMLand
SendRichDraftMarkdownstream a draft into a private chat, with
DraftOptionsfor the topic,CanStopandKeepOnStop(Bot API 10.3). A
press of Stop arrives asUpdate.StoppedMessageGeneration
(MessageGenerationStopped: the chat, the topic and the draft id). A draft
id of zero is refused before sending.
Breaking
CallbackQuery.Messageis a pointer, andCallbackQuery.InlineMessageID
is new. A press on a button of an inline message has no message, and the
zero value read as chat 0; nowMessageis nil there and
InlineMessageIDnames the message. This breaks every bot that reads a
callback's message. The change in each one:cq.Message.Xstays as it is
where the button is on the bot's own message, and a handler that can see
an inline message checkscq.Message == nilfirst; a value passed on as
cq.Messagebecomes*cq.Message.