-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for API 7.3 to 7.8 #6
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this change is missed based on the change log:
Added the field has_main_web_app to the class User, which is returned in the response to getMe.
/** A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode */ | ||
question_entities?: MessageEntity[]; | ||
/** Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed */ | ||
question_parse_mode?: ParseMode; | ||
/** A list of answer options, 2-10 strings 1-100 characters each */ | ||
options: readonly string[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type of this parameter is changed based on the change log:
Added the class InputPollOption and changed the type of the parameter options in the method sendPoll to Array of InputPollOption.
@@ -68,6 +70,8 @@ export declare namespace Message { | |||
caption?: string; | |||
/** For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption */ | |||
caption_entities?: MessageEntity[]; | |||
/** True, if the caption must be shown above the message media */ | |||
show_caption_above_media?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the type of Message:
- show_caption_above_media?: boolean;
+ show_caption_above_media?: true;
/** Pass True, if the caption must be shown above the message media */ | ||
show_caption_above_media?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InputMediaDocument
isn't included in the classes that need show_caption_above_media
as their field based on the change log:
Added the field show_caption_above_media to the classes Message, InputMediaAnimation, InputMediaPhoto, InputMediaVideo, InlineQueryResultGif, InlineQueryResultMpeg4Gif, InlineQueryResultPhoto, InlineQueryResultVideo, InlineQueryResultCachedGif, InlineQueryResultCachedMpeg4Gif, InlineQueryResultCachedPhoto, and InlineQueryResultCachedVideo.
/** Pass True, if the caption must be shown above the message media */ | ||
show_caption_above_media?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InputMediaAudio
isn't included in the classes that need show_caption_above_media
as their field based on the change log:
Added the field show_caption_above_media to the classes Message, InputMediaAnimation, InputMediaPhoto, InputMediaVideo, InlineQueryResultGif, InlineQueryResultMpeg4Gif, InlineQueryResultPhoto, InlineQueryResultVideo, InlineQueryResultCachedGif, InlineQueryResultCachedMpeg4Gif, InlineQueryResultCachedPhoto, and InlineQueryResultCachedVideo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The field provider_token
of class InputInvoiceMessageContent
must become optional base on the change log:
The field provider_token in the class InputInvoiceMessageContent must be omitted for payments in Telegram Stars.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter provider_token
of methods sendInvoice
and createInvoiceLink
must become optional base on the change log:
The parameter provider_token of the methods sendInvoice and createInvoiceLink must be omitted for payments in Telegram Stars.
/** This object represents the content of a media message to be sent. It should be one of | ||
- InputMediaAnimation | ||
- InputMediaDocument | ||
- InputMediaAudio | ||
- InputMediaPhoto | ||
- InputMediaVideo */ | ||
export type InputMedia<F> = | ||
| InputMediaAnimation<F> | ||
| InputMediaDocument<F> | ||
| InputMediaAudio<F> | ||
| InputMediaPhoto<F> | ||
| InputMediaVideo<F>; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see that these are back in the next commit but if you want to have a clean commit history, better to merge Add methods and types for API 7.5
and Adds PaidMedia types
commits. And also, move the Paid Media
types to the Add support for 7.6
commit. These are just suggestions.
I'm very grateful to your work @danielrhodes and @hameda169. Since I've fallen back quite a bit, instead of incrementally updating via the changelog, I diffed an old version of the HTML page I had from before 7.1 and directly jumped to 8.2. Closing this PR in favour of #8. Would love your feedback and reviews there. Thank you! Please do support us in the future! |
Based on https://core.telegram.org/bots/api-changelog