From f23d3cd6e2dbd0705ffe1c3294b5f6bffc4056a1 Mon Sep 17 00:00:00 2001 From: Desiders <abc_desi@proton.me> Date: Tue, 27 Feb 2024 17:12:26 +0300 Subject: [PATCH] Update docs --- telers/src/types/chat_boost_updated.rs | 2 +- telers/src/types/chat_member_administrator.rs | 14 +++++++------- telers/src/types/contact.rs | 1 + telers/src/types/file.rs | 1 + telers/src/types/force_reply.rs | 2 +- telers/src/types/game_high_score.rs | 1 + telers/src/types/giveaway_winners.rs | 2 +- telers/src/types/inline_keyboard_button.rs | 2 +- telers/src/types/inline_keyboard_markup.rs | 2 -- telers/src/types/inline_query_result_audio.rs | 2 -- .../src/types/inline_query_result_cached_audio.rs | 2 -- .../types/inline_query_result_cached_document.rs | 2 -- telers/src/types/inline_query_result_contact.rs | 2 -- telers/src/types/inline_query_result_document.rs | 2 -- telers/src/types/inline_query_result_location.rs | 2 -- telers/src/types/inline_query_result_venue.rs | 2 -- telers/src/types/inline_query_result_voice.rs | 2 -- telers/src/types/keyboard_button.rs | 6 +----- telers/src/types/link_preview_options.rs | 4 ++-- telers/src/types/reply_keyboard_markup.rs | 3 ++- telers/src/types/web_app_user.rs | 1 - 21 files changed, 19 insertions(+), 38 deletions(-) diff --git a/telers/src/types/chat_boost_updated.rs b/telers/src/types/chat_boost_updated.rs index 29c152dc..79db4924 100644 --- a/telers/src/types/chat_boost_updated.rs +++ b/telers/src/types/chat_boost_updated.rs @@ -12,7 +12,7 @@ use serde::Deserialize; pub struct ChatBoostUpdated { /// Chat which was boosted pub chat: Chat, - /// Infomation about the chat boost + /// Information about the chat boost pub boost: ChatBoostSource, } diff --git a/telers/src/types/chat_member_administrator.rs b/telers/src/types/chat_member_administrator.rs index 7db40c99..a493148f 100644 --- a/telers/src/types/chat_member_administrator.rs +++ b/telers/src/types/chat_member_administrator.rs @@ -14,31 +14,31 @@ pub struct ChatMemberAdministrator { pub can_be_edited: bool, /// `true`, if the user's presence in the chat is hidden pub is_anonymous: bool, - /// `true`, if the administrator can access the chat event log, chat statistics, boost list in channels, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege + /// `true`, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode. Implied by any other administrator privilege. pub can_manage_chat: bool, /// `true`, if the administrator can delete messages of other users pub can_delete_messages: bool, /// `true`, if the administrator can manage video chats pub can_manage_video_chats: bool, - /// `true`, if the administrator can restrict, ban or unban chat members + /// `true`, if the administrator can restrict, ban or unban chat members, or access supergroup statistics pub can_restrict_members: bool, - /// `true`, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user) + /// `true`, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user) pub can_promote_members: bool, /// `true`, if the user is allowed to change the chat title, photo and other settings pub can_change_info: bool, /// `true`, if the user is allowed to invite new users to the chat pub can_invite_users: bool, - /// `true`, if the administrator can post messages in the channel; channels only + /// `true`, if the administrator can post messages in the channel, or access channel statistics; channels only pub can_post_messages: Option<bool>, /// `true`, if the administrator can edit messages of other users and can pin messages; channels only pub can_edit_messages: Option<bool>, /// `true`, if the user is allowed to pin messages; groups and supergroups only pub can_pin_messages: Option<bool>, - /// `true`, if the administrator can post stories in the channel; channels only + /// `true`, if the administrator can post stories to the chat pub can_post_stories: Option<bool>, - /// `true`, if the administrator can edit stories posted by other users; channels only + /// `true`, if the administrator can edit stories posted by other users pub can_edit_stories: Option<bool>, - /// `true`, if the administrator can delete stories posted by other users; channels only + /// `true`, if the administrator can delete stories posted by other users pub can_delete_stories: Option<bool>, /// `true`, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only pub can_manage_topics: Option<bool>, diff --git a/telers/src/types/contact.rs b/telers/src/types/contact.rs index f8208442..e83f7974 100644 --- a/telers/src/types/contact.rs +++ b/telers/src/types/contact.rs @@ -1,6 +1,7 @@ use serde::Deserialize; /// This object represents a phone contact. +/// # Documentation /// <https://core.telegram.org/bots/api#contact> #[derive(Debug, Clone, Hash, PartialEq, Eq, Deserialize)] pub struct Contact { diff --git a/telers/src/types/file.rs b/telers/src/types/file.rs index f6a81e92..052ca2d8 100644 --- a/telers/src/types/file.rs +++ b/telers/src/types/file.rs @@ -2,6 +2,7 @@ use serde::Deserialize; /// This object represents a file ready to be downloaded. The file can be downloaded via the link `https://api.telegram.org/file/bot<token>/<file_path>`. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling [`GetFile`](crate::methods::GetFile). /// The maximum file size to download is 20 MB +/// # Documentation /// <https://core.telegram.org/bots/api#file> #[derive(Debug, Clone, Hash, PartialEq, Eq, Deserialize)] pub struct File { diff --git a/telers/src/types/force_reply.rs b/telers/src/types/force_reply.rs index 9a5c8ec2..fb03b166 100644 --- a/telers/src/types/force_reply.rs +++ b/telers/src/types/force_reply.rs @@ -15,7 +15,7 @@ pub struct ForceReply { pub force_reply: bool, /// The placeholder to be shown in the input field when the reply is active; 1-64 characters pub input_field_placeholder: Option<String>, - /// Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the *text* of the [`Message`](crate::types::Message) object; 2) if the bot's message is a reply (has *reply_to_message_id*), sender of the original message. + /// Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the [`Message`](crate::types::Message) object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message. pub selective: Option<bool>, } diff --git a/telers/src/types/game_high_score.rs b/telers/src/types/game_high_score.rs index 66c1ff3b..de9cf0d1 100644 --- a/telers/src/types/game_high_score.rs +++ b/telers/src/types/game_high_score.rs @@ -3,6 +3,7 @@ use serde::Deserialize; /// This object represents one row of the high scores table for a game. /// And that's about all we've got for now. /// If you've got any questions, please check out our `https://core.telegram.org/bots/faq <https://core.telegram.org/bots/faq>` **Bot FAQ ยป** +/// # Documentation /// <https://core.telegram.org/bots/api#gamehighscore> #[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, Deserialize)] pub struct GameHighScore {} diff --git a/telers/src/types/giveaway_winners.rs b/telers/src/types/giveaway_winners.rs index 86d921f8..2d58b85e 100644 --- a/telers/src/types/giveaway_winners.rs +++ b/telers/src/types/giveaway_winners.rs @@ -9,7 +9,7 @@ use super::{Chat, User}; pub struct GiveawayWinners { /// The chat that created the giveaway pub chat: Chat, - /// Identifier of the messsage with the giveaway in the chat + /// Identifier of the message with the giveaway in the chat pub giveaway_message_id: i64, /// Point in time (Unix timestamp) when winners of the giveaway were selected pub winners_selection_date: i64, diff --git a/telers/src/types/inline_keyboard_button.rs b/telers/src/types/inline_keyboard_button.rs index ff4ae6f1..5697d262 100644 --- a/telers/src/types/inline_keyboard_button.rs +++ b/telers/src/types/inline_keyboard_button.rs @@ -11,7 +11,7 @@ use serde_with::skip_serializing_none; pub struct InlineKeyboardButton { /// Label text on the button pub text: String, - /// HTTP or tg:// URL to be opened when the button is pressed. Links `tg://user?id=<user_id>` can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings. + /// HTTP or tg:// URL to be opened when the button is pressed. Links `tg://user?id=<user_id>` can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings. pub url: Option<String>, /// Data to be sent in a [`callback query`](https://core.telegram.org/bots/api#callbackquery) to the bot when button is pressed, 1-64 bytes pub callback_data: Option<String>, diff --git a/telers/src/types/inline_keyboard_markup.rs b/telers/src/types/inline_keyboard_markup.rs index 366412fd..a59ad9b1 100644 --- a/telers/src/types/inline_keyboard_markup.rs +++ b/telers/src/types/inline_keyboard_markup.rs @@ -3,8 +3,6 @@ use super::InlineKeyboardButton; use serde::{Deserialize, Serialize}; /// This object represents an [`inline keyboard`](https://core.telegram.org/bots/features#inline-keyboards) that appears right next to the message it belongs to. -/// # Notes -/// This will only work in Telegram versions released after 9 April, 2016. Older clients will display *unsupported message*. /// # Documentation /// <https://core.telegram.org/bots/api#inlinekeyboardmarkup> #[derive(Debug, Default, Clone, Hash, PartialEq, Eq, Deserialize, Serialize)] diff --git a/telers/src/types/inline_query_result_audio.rs b/telers/src/types/inline_query_result_audio.rs index 0c9564e6..4e28aba6 100644 --- a/telers/src/types/inline_query_result_audio.rs +++ b/telers/src/types/inline_query_result_audio.rs @@ -4,8 +4,6 @@ use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; /// Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use `input_message_content` to send a message with the specified content instead of the audio. -/// # Notes -/// This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. /// # Documentation /// <https://core.telegram.org/bots/api#inlinequeryresultaudio> #[skip_serializing_none] diff --git a/telers/src/types/inline_query_result_cached_audio.rs b/telers/src/types/inline_query_result_cached_audio.rs index 0670d316..8b06b821 100644 --- a/telers/src/types/inline_query_result_cached_audio.rs +++ b/telers/src/types/inline_query_result_cached_audio.rs @@ -4,8 +4,6 @@ use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; /// Represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use `input_message_content` to send a message with the specified content instead of the audio. -/// # Notes -/// This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. /// # Documentation /// <https://core.telegram.org/bots/api#inlinequeryresultcachedaudio> #[skip_serializing_none] diff --git a/telers/src/types/inline_query_result_cached_document.rs b/telers/src/types/inline_query_result_cached_document.rs index 98949dde..77164a71 100644 --- a/telers/src/types/inline_query_result_cached_document.rs +++ b/telers/src/types/inline_query_result_cached_document.rs @@ -4,8 +4,6 @@ use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; /// Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use `input_message_content` to send a message with the specified content instead of the file. -/// # Notes -/// This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. /// # Documentation /// <https://core.telegram.org/bots/api#inlinequeryresultcacheddocument> #[skip_serializing_none] diff --git a/telers/src/types/inline_query_result_contact.rs b/telers/src/types/inline_query_result_contact.rs index d2aef132..9cdc663e 100644 --- a/telers/src/types/inline_query_result_contact.rs +++ b/telers/src/types/inline_query_result_contact.rs @@ -4,8 +4,6 @@ use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; /// Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use `input_message_content` to send a message with the specified content instead of the contact. -/// # Notes -/// This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. /// # Documentation /// <https://core.telegram.org/bots/api#inlinequeryresultcontact> #[skip_serializing_none] diff --git a/telers/src/types/inline_query_result_document.rs b/telers/src/types/inline_query_result_document.rs index ff68b9b3..2b7fd032 100644 --- a/telers/src/types/inline_query_result_document.rs +++ b/telers/src/types/inline_query_result_document.rs @@ -4,8 +4,6 @@ use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; /// Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use `input_message_content` to send a message with the specified content instead of the file. Currently, only **.PDF** and **.ZIP** files can be sent using this method. -/// # Notes -/// This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. /// # Documentation /// <https://core.telegram.org/bots/api#inlinequeryresultdocument> #[skip_serializing_none] diff --git a/telers/src/types/inline_query_result_location.rs b/telers/src/types/inline_query_result_location.rs index 0b52cc5c..479b6285 100644 --- a/telers/src/types/inline_query_result_location.rs +++ b/telers/src/types/inline_query_result_location.rs @@ -4,8 +4,6 @@ use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; /// Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use `input_message_content` to send a message with the specified content instead of the location. -/// # Notes -/// This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. /// # Documentation /// <https://core.telegram.org/bots/api#inlinequeryresultlocation> #[skip_serializing_none] diff --git a/telers/src/types/inline_query_result_venue.rs b/telers/src/types/inline_query_result_venue.rs index 2ed1be7f..c46a6c97 100644 --- a/telers/src/types/inline_query_result_venue.rs +++ b/telers/src/types/inline_query_result_venue.rs @@ -4,8 +4,6 @@ use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; /// Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use `input_message_content` to send a message with the specified content instead of the venue. -/// # Notes -/// This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. /// # Documentation /// <https://core.telegram.org/bots/api#inlinequeryresultvenue> #[skip_serializing_none] diff --git a/telers/src/types/inline_query_result_voice.rs b/telers/src/types/inline_query_result_voice.rs index b38bbe29..512ff32c 100644 --- a/telers/src/types/inline_query_result_voice.rs +++ b/telers/src/types/inline_query_result_voice.rs @@ -4,8 +4,6 @@ use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; /// Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use `input_message_content` to send a message with the specified content instead of the the voice message. -/// # Notes -/// This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. /// # Documentation /// <https://core.telegram.org/bots/api#inlinequeryresultvoice> #[skip_serializing_none] diff --git a/telers/src/types/keyboard_button.rs b/telers/src/types/keyboard_button.rs index cd4e1f28..2d962437 100644 --- a/telers/src/types/keyboard_button.rs +++ b/telers/src/types/keyboard_button.rs @@ -5,11 +5,7 @@ use super::{ use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; -/// This object represents one button of the reply keyboard. For simple text buttons *String* can be used instead of this object to specify text of the button. Optional fields `web_app`, `request_contact`, `request_location`, and `request_poll` are mutually exclusive. -/// # Notes -/// - `request_contact` and `request_location` options will only work in Telegram versions released after 9 April, 2016. Older clients will display *unsupported message*. -/// - `request_poll` option will only work in Telegram versions released after 23 January, 2020. Older clients will display *unsupported message*. -/// - `web_app` option will only work in Telegram versions released after 16 April, 2022. Older clients will display *unsupported message*. +/// This object represents one button of the reply keyboard. For simple text buttons *String* can be used instead of this object to specify text of the button. Optional fields `web_app`, `request_users`, `request_chat`, `request_contact`, `request_location`, and `request_poll` are mutually exclusive. /// # Documentation /// <https://core.telegram.org/bots/api#keyboardbutton> #[skip_serializing_none] diff --git a/telers/src/types/link_preview_options.rs b/telers/src/types/link_preview_options.rs index c48c4688..4f3299ce 100644 --- a/telers/src/types/link_preview_options.rs +++ b/telers/src/types/link_preview_options.rs @@ -11,9 +11,9 @@ pub struct LinkPreviewOptions { pub is_disabled: Option<bool>, /// URL to use for the link preview. If empty, then the first URL found in the message text will be used pub url: Option<String>, - /// `true`, if the media in the link preview is suppposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview + /// `true`, if the media in the link preview is supposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview pub prefer_small_media: Option<bool>, - /// `true`, if the media in the link preview is suppposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview + /// `true`, if the media in the link preview is supposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview pub prefer_large_media: Option<bool>, /// `true`, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text pub show_above_text: Option<bool>, diff --git a/telers/src/types/reply_keyboard_markup.rs b/telers/src/types/reply_keyboard_markup.rs index 04bdba81..c25f48b5 100644 --- a/telers/src/types/reply_keyboard_markup.rs +++ b/telers/src/types/reply_keyboard_markup.rs @@ -19,7 +19,8 @@ pub struct ReplyKeyboardMarkup { pub one_time_keyboard: Option<bool>, /// The placeholder to be shown in the input field when the keyboard is active; 1-64 characters pub input_field_placeholder: Option<String>, - /// Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the *text* of the [`Message`](crate::types::Message) object; 2) if the bot's message is a reply (has *reply_to_message_id*), sender of the original message. + /// Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the [`Message`](crate::types::Message) object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message. + /// Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard. pub selective: Option<bool>, } diff --git a/telers/src/types/web_app_user.rs b/telers/src/types/web_app_user.rs index 82020d7e..fb85a1c0 100644 --- a/telers/src/types/web_app_user.rs +++ b/telers/src/types/web_app_user.rs @@ -1,7 +1,6 @@ use serde::Deserialize; /// This object contains the data of the Mini App user. -/// # Documentation /// <https://core.telegram.org/bots/webapps#webappuser> #[derive(Debug, Clone, Hash, PartialEq, Eq, Deserialize)] pub struct WebAppUser {