Skip to content
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

Closed
wants to merge 11 commits into from

Conversation

danielrhodes
Copy link

Copy link

@hameda169 hameda169 left a 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[];

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;
Copy link

@hameda169 hameda169 Jan 6, 2025

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;

Comment on lines +1975 to +1976
/** Pass True, if the caption must be shown above the message media */
show_caption_above_media?: boolean;

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.

Comment on lines +1951 to +1952
/** Pass True, if the caption must be shown above the message media */
show_caption_above_media?: boolean;

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.

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.

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.

Comment on lines -1852 to -1864
/** 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>;

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.

@MKRhere
Copy link
Member

MKRhere commented Jan 10, 2025

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!

@MKRhere MKRhere closed this Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants