Fix doc links...

This commit is contained in:
Waffle 2020-11-27 02:13:50 +03:00
parent 1882ff0bc4
commit 3491a668b2
7 changed files with 84 additions and 85 deletions

View file

@ -10,7 +10,7 @@ use crate::{
impl Bot { impl Bot {
/// Download a file from Telegram into `destination`. /// Download a file from Telegram into `destination`.
/// ///
/// `path` can be obtained from [`Bot::get_file`]. /// `path` can be obtained from [`GetFile`].
/// ///
/// To download as a stream of chunks, see [`Bot::download_file_stream`]. /// To download as a stream of chunks, see [`Bot::download_file_stream`].
/// ///
@ -33,7 +33,7 @@ impl Bot {
/// # Ok(()) } /// # Ok(()) }
/// ``` /// ```
/// ///
/// [`Bot::get_file`]: crate::Bot::get_file /// [`GetFile`]: crate::payloads::GetFile
/// [`Bot::download_file_stream`]: crate::Bot::download_file_stream /// [`Bot::download_file_stream`]: crate::Bot::download_file_stream
pub async fn download_file<D>( pub async fn download_file<D>(
&self, &self,
@ -48,12 +48,12 @@ impl Bot {
/// Download a file from Telegram. /// Download a file from Telegram.
/// ///
/// `path` can be obtained from the [`Bot::get_file`]. /// `path` can be obtained from the [`GetFile`].
/// ///
/// To download into [`AsyncWrite`] (e.g. [`tokio::fs::File`]), see /// To download into [`AsyncWrite`] (e.g. [`tokio::fs::File`]), see
/// [`Bot::download_file`]. /// [`Bot::download_file`].
/// ///
/// [`Bot::get_file`]: crate::bot::Bot::get_file /// [`GetFile`]: crate::payloads::GetFile
/// [`AsyncWrite`]: tokio::io::AsyncWrite /// [`AsyncWrite`]: tokio::io::AsyncWrite
/// [`tokio::fs::File`]: tokio::fs::File /// [`tokio::fs::File`]: tokio::fs::File
/// [`Bot::download_file`]: crate::Bot::download_file /// [`Bot::download_file`]: crate::Bot::download_file

View file

@ -70,7 +70,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`EditMessageText`] /// 1. [`EditMessageText`]
/// ///
/// [`EditMessageText`]: crate::requests::EditMessageText /// [`EditMessageText`]: crate::payloads::EditMessageText
#[serde(rename = "Bad Request: message is not modified: specified new message content and \ #[serde(rename = "Bad Request: message is not modified: specified new message content and \
reply markup are exactly the same as a current content and reply markup \ reply markup are exactly the same as a current content and reply markup \
of the message")] of the message")]
@ -82,8 +82,8 @@ pub enum ApiError {
/// 1. [`ForwardMessage`] /// 1. [`ForwardMessage`]
/// 2. [`DeleteMessage`] /// 2. [`DeleteMessage`]
/// ///
/// [`ForwardMessage`]: crate::requests::ForwardMessage /// [`ForwardMessage`]: crate::payloads::ForwardMessage
/// [`DeleteMessage`]: crate::requests::DeleteMessage /// [`DeleteMessage`]: crate::payloads::DeleteMessage
#[serde(rename = "Bad Request: MESSAGE_ID_INVALID")] #[serde(rename = "Bad Request: MESSAGE_ID_INVALID")]
MessageIdInvalid, MessageIdInvalid,
@ -92,7 +92,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`ForwardMessage`] /// 1. [`ForwardMessage`]
/// ///
/// [`ForwardMessage`]: crate::requests::ForwardMessage /// [`ForwardMessage`]: crate::payloads::ForwardMessage
#[serde(rename = "Bad Request: message to forward not found")] #[serde(rename = "Bad Request: message to forward not found")]
MessageToForwardNotFound, MessageToForwardNotFound,
@ -101,7 +101,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`DeleteMessage`] /// 1. [`DeleteMessage`]
/// ///
/// [`DeleteMessage`]: crate::requests::DeleteMessage /// [`DeleteMessage`]: crate::payloads::DeleteMessage
#[serde(rename = "Bad Request: message to delete not found")] #[serde(rename = "Bad Request: message to delete not found")]
MessageToDeleteNotFound, MessageToDeleteNotFound,
@ -110,7 +110,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SendMessage`] /// 1. [`SendMessage`]
/// ///
/// [`SendMessage`]: crate::requests::SendMessage /// [`SendMessage`]: crate::payloads::SendMessage
#[serde(rename = "Bad Request: message text is empty")] #[serde(rename = "Bad Request: message text is empty")]
MessageTextIsEmpty, MessageTextIsEmpty,
@ -119,7 +119,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`EditMessageText`] /// 1. [`EditMessageText`]
/// ///
/// [`EditMessageText`]: crate::requests::EditMessageText /// [`EditMessageText`]: crate::payloads::EditMessageText
#[serde(rename = "Bad Request: message can't be edited")] #[serde(rename = "Bad Request: message can't be edited")]
MessageCantBeEdited, MessageCantBeEdited,
@ -129,7 +129,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`DeleteMessage`] /// 1. [`DeleteMessage`]
/// ///
/// [`DeleteMessage`]: crate::requests::DeleteMessage /// [`DeleteMessage`]: crate::payloads::DeleteMessage
#[serde(rename = "Bad Request: message can't be deleted")] #[serde(rename = "Bad Request: message can't be deleted")]
MessageCantBeDeleted, MessageCantBeDeleted,
@ -138,7 +138,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`EditMessageText`] /// 1. [`EditMessageText`]
/// ///
/// [`EditMessageText`]: crate::requests::EditMessageText /// [`EditMessageText`]: crate::payloads::EditMessageText
#[serde(rename = "Bad Request: message to edit not found")] #[serde(rename = "Bad Request: message to edit not found")]
MessageToEditNotFound, MessageToEditNotFound,
@ -147,7 +147,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SendMessage`] /// 1. [`SendMessage`]
/// ///
/// [`SendMessage`]: crate::requests::SendMessage /// [`SendMessage`]: crate::payloads::SendMessage
#[serde(rename = "Bad Request: reply message not found")] #[serde(rename = "Bad Request: reply message not found")]
MessageToReplyNotFound, MessageToReplyNotFound,
@ -161,7 +161,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SendMessage`] /// 1. [`SendMessage`]
/// ///
/// [`SendMessage`]: crate::requests::SendMessage /// [`SendMessage`]: crate::payloads::SendMessage
#[serde(rename = "Bad Request: message is too long")] #[serde(rename = "Bad Request: message is too long")]
MessageIsTooLong, MessageIsTooLong,
@ -170,7 +170,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SendMediaGroup`] /// 1. [`SendMediaGroup`]
/// ///
/// [`SendMediaGroup`]: crate::requests::SendMediaGroup /// [`SendMediaGroup`]: crate::payloads::SendMediaGroup
#[serde(rename = "Bad Request: Too much messages to send as an album")] #[serde(rename = "Bad Request: Too much messages to send as an album")]
ToMuchMessages, ToMuchMessages,
@ -179,7 +179,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SendPoll`] /// 1. [`SendPoll`]
/// ///
/// [`SendPoll`]: crate::requests::SendPoll /// [`SendPoll`]: crate::payloads::SendPoll
#[serde(rename = "Bad Request: poll has already been closed")] #[serde(rename = "Bad Request: poll has already been closed")]
PollHasAlreadyClosed, PollHasAlreadyClosed,
@ -188,7 +188,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SendPoll`] /// 1. [`SendPoll`]
/// ///
/// [`SendPoll`]: crate::requests::SendPoll /// [`SendPoll`]: crate::payloads::SendPoll
#[serde(rename = "Bad Request: poll must have at least 2 option")] #[serde(rename = "Bad Request: poll must have at least 2 option")]
PollMustHaveMoreOptions, PollMustHaveMoreOptions,
@ -197,7 +197,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SendPoll`] /// 1. [`SendPoll`]
/// ///
/// [`SendPoll`]: crate::requests::SendPoll /// [`SendPoll`]: crate::payloads::SendPoll
#[serde(rename = "Bad Request: poll can't have more than 10 options")] #[serde(rename = "Bad Request: poll can't have more than 10 options")]
PollCantHaveMoreOptions, PollCantHaveMoreOptions,
@ -206,7 +206,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SendPoll`] /// 1. [`SendPoll`]
/// ///
/// [`SendPoll`]: crate::requests::SendPoll /// [`SendPoll`]: crate::payloads::SendPoll
#[serde(rename = "Bad Request: poll options must be non-empty")] #[serde(rename = "Bad Request: poll options must be non-empty")]
PollOptionsMustBeNonEmpty, PollOptionsMustBeNonEmpty,
@ -215,7 +215,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SendPoll`] /// 1. [`SendPoll`]
/// ///
/// [`SendPoll`]: crate::requests::SendPoll /// [`SendPoll`]: crate::payloads::SendPoll
#[serde(rename = "Bad Request: poll question must be non-empty")] #[serde(rename = "Bad Request: poll question must be non-empty")]
PollQuestionMustBeNonEmpty, PollQuestionMustBeNonEmpty,
@ -225,7 +225,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SendPoll`] /// 1. [`SendPoll`]
/// ///
/// [`SendPoll`]: crate::requests::SendPoll /// [`SendPoll`]: crate::payloads::SendPoll
#[serde(rename = "Bad Request: poll options length must not exceed 100")] #[serde(rename = "Bad Request: poll options length must not exceed 100")]
PollOptionsLengthTooLong, PollOptionsLengthTooLong,
@ -235,7 +235,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SendPoll`] /// 1. [`SendPoll`]
/// ///
/// [`SendPoll`]: crate::requests::SendPoll /// [`SendPoll`]: crate::payloads::SendPoll
#[serde(rename = "Bad Request: poll question length must not exceed 255")] #[serde(rename = "Bad Request: poll question length must not exceed 255")]
PollQuestionLengthTooLong, PollQuestionLengthTooLong,
@ -244,7 +244,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`StopPoll`] /// 1. [`StopPoll`]
/// ///
/// [`StopPoll`]: crate::requests::StopPoll /// [`StopPoll`]: crate::payloads::StopPoll
#[serde(rename = "Bad Request: message with poll to stop not found")] #[serde(rename = "Bad Request: message with poll to stop not found")]
MessageWithPollNotFound, MessageWithPollNotFound,
@ -253,7 +253,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`StopPoll`] /// 1. [`StopPoll`]
/// ///
/// [`StopPoll`]: crate::requests::StopPoll /// [`StopPoll`]: crate::payloads::StopPoll
#[serde(rename = "Bad Request: message is not a poll")] #[serde(rename = "Bad Request: message is not a poll")]
MessageIsNotAPoll, MessageIsNotAPoll,
@ -263,7 +263,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SendMessage`] /// 1. [`SendMessage`]
/// ///
/// [`SendMessage`]: crate::requests::SendMessage /// [`SendMessage`]: crate::payloads::SendMessage
#[serde(rename = "Bad Request: chat not found")] #[serde(rename = "Bad Request: chat not found")]
ChatNotFound, ChatNotFound,
@ -273,7 +273,7 @@ pub enum ApiError {
/// 1. [`getUserProfilePhotos`] /// 1. [`getUserProfilePhotos`]
/// ///
/// [`getUserProfilePhotos`]: /// [`getUserProfilePhotos`]:
/// crate::requests::GetUserProfilePhotos /// crate::payloads::GetUserProfilePhotos
#[serde(rename = "Bad Request: user not found")] #[serde(rename = "Bad Request: user not found")]
UserNotFound, UserNotFound,
@ -283,7 +283,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SetChatDescription`] /// 1. [`SetChatDescription`]
/// ///
/// [`SetChatDescription`]: crate::requests::SetChatDescription /// [`SetChatDescription`]: crate::payloads::SetChatDescription
#[serde(rename = "Bad Request: chat description is not modified")] #[serde(rename = "Bad Request: chat description is not modified")]
ChatDescriptionIsNotModified, ChatDescriptionIsNotModified,
@ -292,7 +292,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`AnswerCallbackQuery`] /// 1. [`AnswerCallbackQuery`]
/// ///
/// [`AnswerCallbackQuery`]: crate::requests::AnswerCallbackQuery /// [`AnswerCallbackQuery`]: crate::payloads::AnswerCallbackQuery
#[serde(rename = "Bad Request: query is too old and response timeout expired or query id is \ #[serde(rename = "Bad Request: query is too old and response timeout expired or query id is \
invalid")] invalid")]
InvalidQueryID, InvalidQueryID,
@ -303,7 +303,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SendMessage`] /// 1. [`SendMessage`]
/// ///
/// [`SendMessage`]: crate::requests::SendMessage /// [`SendMessage`]: crate::payloads::SendMessage
#[serde(rename = "Bad Request: BUTTON_URL_INVALID")] #[serde(rename = "Bad Request: BUTTON_URL_INVALID")]
ButtonURLInvalid, ButtonURLInvalid,
@ -312,7 +312,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SendMessage`] /// 1. [`SendMessage`]
/// ///
/// [`SendMessage`]: crate::requests::SendMessage /// [`SendMessage`]: crate::payloads::SendMessage
#[serde(rename = "Bad Request: BUTTON_DATA_INVALID")] #[serde(rename = "Bad Request: BUTTON_DATA_INVALID")]
ButtonDataInvalid, ButtonDataInvalid,
@ -321,7 +321,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SendMessage`] /// 1. [`SendMessage`]
/// ///
/// [`SendMessage`]: crate::requests::SendMessage /// [`SendMessage`]: crate::payloads::SendMessage
#[serde(rename = "Bad Request: can't parse inline keyboard button: Text buttons are \ #[serde(rename = "Bad Request: can't parse inline keyboard button: Text buttons are \
unallowed in the inline keyboard")] unallowed in the inline keyboard")]
TextButtonsAreUnallowed, TextButtonsAreUnallowed,
@ -331,7 +331,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`GetFile`] /// 1. [`GetFile`]
/// ///
/// [`GetFile`]: crate::requests::GetFile /// [`GetFile`]: crate::payloads::GetFile
#[serde(rename = "Bad Request: wrong file id")] #[serde(rename = "Bad Request: wrong file id")]
WrongFileID, WrongFileID,
@ -344,7 +344,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SetChatPhoto`] /// 1. [`SetChatPhoto`]
/// ///
/// [`SetChatPhoto`]: crate::requests::SetChatPhoto /// [`SetChatPhoto`]: crate::payloads::SetChatPhoto
#[serde(rename = "Bad Request: Photo should be uploaded as an InputFile")] #[serde(rename = "Bad Request: Photo should be uploaded as an InputFile")]
PhotoAsInputFileRequired, PhotoAsInputFileRequired,
@ -353,7 +353,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`AddStickerToSet`] /// 1. [`AddStickerToSet`]
/// ///
/// [`AddStickerToSet`]: crate::requests::AddStickerToSet /// [`AddStickerToSet`]: crate::payloads::AddStickerToSet
#[serde(rename = "Bad Request: STICKERSET_INVALID")] #[serde(rename = "Bad Request: STICKERSET_INVALID")]
InvalidStickersSet, InvalidStickersSet,
@ -363,7 +363,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`PinChatMessage`] /// 1. [`PinChatMessage`]
/// ///
/// [`PinChatMessage`]: crate::requests::PinChatMessage /// [`PinChatMessage`]: crate::payloads::PinChatMessage
#[serde(rename = "Bad Request: not enough rights to pin a message")] #[serde(rename = "Bad Request: not enough rights to pin a message")]
NotEnoughRightsToPinMessage, NotEnoughRightsToPinMessage,
@ -377,7 +377,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`PromoteChatMember`] /// 1. [`PromoteChatMember`]
/// ///
/// [`PromoteChatMember`]: crate::requests::PromoteChatMember /// [`PromoteChatMember`]: crate::payloads::PromoteChatMember
#[serde(rename = "Bad Request: can't demote chat creator")] #[serde(rename = "Bad Request: can't demote chat creator")]
CantDemoteChatCreator, CantDemoteChatCreator,
@ -386,7 +386,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`RestrictChatMember`] /// 1. [`RestrictChatMember`]
/// ///
/// [`RestrictChatMember`]: crate::requests::RestrictChatMember /// [`RestrictChatMember`]: crate::payloads::RestrictChatMember
#[serde(rename = "Bad Request: can't restrict self")] #[serde(rename = "Bad Request: can't restrict self")]
CantRestrictSelf, CantRestrictSelf,
@ -396,7 +396,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`RestrictChatMember`] /// 1. [`RestrictChatMember`]
/// ///
/// [`RestrictChatMember`]: crate::requests::RestrictChatMember /// [`RestrictChatMember`]: crate::payloads::RestrictChatMember
#[serde(rename = "Bad Request: not enough rights to restrict/unrestrict chat member")] #[serde(rename = "Bad Request: not enough rights to restrict/unrestrict chat member")]
NotEnoughRightsToRestrict, NotEnoughRightsToRestrict,
@ -405,7 +405,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SetWebhook`] /// 1. [`SetWebhook`]
/// ///
/// [`SetWebhook`]: crate::requests::SetWebhook /// [`SetWebhook`]: crate::payloads::SetWebhook
#[serde(rename = "Bad Request: bad webhook: HTTPS url must be provided for webhook")] #[serde(rename = "Bad Request: bad webhook: HTTPS url must be provided for webhook")]
WebhookRequireHTTPS, WebhookRequireHTTPS,
@ -415,7 +415,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SetWebhook`] /// 1. [`SetWebhook`]
/// ///
/// [`SetWebhook`]: crate::requests::SetWebhook /// [`SetWebhook`]: crate::payloads::SetWebhook
#[serde(rename = "Bad Request: bad webhook: Webhook can be set up only on ports 80, 88, 443 \ #[serde(rename = "Bad Request: bad webhook: Webhook can be set up only on ports 80, 88, 443 \
or 8443")] or 8443")]
BadWebhookPort, BadWebhookPort,
@ -425,7 +425,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SetWebhook`] /// 1. [`SetWebhook`]
/// ///
/// [`SetWebhook`]: crate::requests::SetWebhook /// [`SetWebhook`]: crate::payloads::SetWebhook
#[serde(rename = "Bad Request: bad webhook: Failed to resolve host: Name or service not known")] #[serde(rename = "Bad Request: bad webhook: Failed to resolve host: Name or service not known")]
UnknownHost, UnknownHost,
@ -434,7 +434,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SetWebhook`] /// 1. [`SetWebhook`]
/// ///
/// [`SetWebhook`]: crate::requests::SetWebhook /// [`SetWebhook`]: crate::payloads::SetWebhook
#[serde(rename = "Bad Request: can't parse URL")] #[serde(rename = "Bad Request: can't parse URL")]
CantParseUrl, CantParseUrl,
@ -443,7 +443,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SendMessage`] /// 1. [`SendMessage`]
/// ///
/// [`SendMessage`]: crate::requests::SendMessage /// [`SendMessage`]: crate::payloads::SendMessage
#[serde(rename = "Bad Request: can't parse entities")] #[serde(rename = "Bad Request: can't parse entities")]
CantParseEntities, CantParseEntities,
@ -452,7 +452,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`GetUpdates`] /// 1. [`GetUpdates`]
/// ///
/// [`GetUpdates`]: crate::requests::GetUpdates /// [`GetUpdates`]: crate::payloads::GetUpdates
#[serde(rename = "can't use getUpdates method while webhook is active")] #[serde(rename = "can't use getUpdates method while webhook is active")]
CantGetUpdates, CantGetUpdates,
@ -461,7 +461,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SendMessage`] /// 1. [`SendMessage`]
/// ///
/// [`SendMessage`]: crate::requests::SendMessage /// [`SendMessage`]: crate::payloads::SendMessage
#[serde(rename = "Unauthorized: bot was kicked from a chat")] #[serde(rename = "Unauthorized: bot was kicked from a chat")]
BotKicked, BotKicked,
@ -470,7 +470,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SendMessage`] /// 1. [`SendMessage`]
/// ///
/// [`SendMessage`]: crate::requests::SendMessage /// [`SendMessage`]: crate::payloads::SendMessage
#[serde(rename = "Unauthorized: user is deactivated")] #[serde(rename = "Unauthorized: user is deactivated")]
UserDeactivated, UserDeactivated,
@ -479,7 +479,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SendMessage`] /// 1. [`SendMessage`]
/// ///
/// [`SendMessage`]: crate::requests::SendMessage /// [`SendMessage`]: crate::payloads::SendMessage
#[serde(rename = "Unauthorized: bot can't initiate conversation with a user")] #[serde(rename = "Unauthorized: bot can't initiate conversation with a user")]
CantInitiateConversation, CantInitiateConversation,
@ -488,7 +488,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SendMessage`] /// 1. [`SendMessage`]
/// ///
/// [`SendMessage`]: crate::requests::SendMessage /// [`SendMessage`]: crate::payloads::SendMessage
#[serde(rename = "Unauthorized: bot can't send messages to bots")] #[serde(rename = "Unauthorized: bot can't send messages to bots")]
CantTalkWithBots, CantTalkWithBots,
@ -497,7 +497,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`SendMessage`] /// 1. [`SendMessage`]
/// ///
/// [`SendMessage`]: crate::requests::SendMessage /// [`SendMessage`]: crate::payloads::SendMessage
#[serde(rename = "Bad Request: wrong HTTP URL")] #[serde(rename = "Bad Request: wrong HTTP URL")]
WrongHTTPurl, WrongHTTPurl,
@ -507,7 +507,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`GetUpdates`] /// 1. [`GetUpdates`]
/// ///
/// [`GetUpdates`]: crate::requests::GetUpdates /// [`GetUpdates`]: crate::payloads::GetUpdates
#[serde(rename = "Conflict: terminated by other getUpdates request; make sure that only one \ #[serde(rename = "Conflict: terminated by other getUpdates request; make sure that only one \
bot instance is running")] bot instance is running")]
TerminatedByOtherGetUpdates, TerminatedByOtherGetUpdates,
@ -517,7 +517,7 @@ pub enum ApiError {
/// May happen in methods: /// May happen in methods:
/// 1. [`GetFile`] /// 1. [`GetFile`]
/// ///
/// [`GetFile`]: crate::requests::GetFile /// [`GetFile`]: crate::payloads::GetFile
#[serde(rename = "Bad Request: invalid file id")] #[serde(rename = "Bad Request: invalid file id")]
FileIdInvalid, FileIdInvalid,

View file

@ -18,9 +18,9 @@ pub struct Chat {
#[serde(flatten)] #[serde(flatten)]
pub kind: ChatKind, pub kind: ChatKind,
/// A chat photo. Returned only in [`Bot::get_chat`]. /// A chat photo. Returned only in [`GetChat`].
/// ///
/// [`Bot::get_chat`]: crate::Bot::get_chat /// [`GetChat`]: crate::payloads::GetChat
pub photo: Option<ChatPhoto>, pub photo: Option<ChatPhoto>,
} }
@ -63,27 +63,27 @@ pub struct ChatPublic {
pub kind: PublicChatKind, pub kind: PublicChatKind,
/// A description, for groups, supergroups and channel chats. Returned /// A description, for groups, supergroups and channel chats. Returned
/// only in [`Bot::get_chat`]. /// only in [`GetChat`].
/// ///
/// [`Bot::get_chat`]: crate::Bot::get_chat /// [`GetChat`]: crate::payloads::GetChat
pub description: Option<String>, pub description: Option<String>,
/// A chat invite link, for groups, supergroups and channel chats. Each /// A chat invite link, for groups, supergroups and channel chats. Each
/// administrator in a chat generates their own invite links, so the /// administrator in a chat generates their own invite links, so the
/// bot must first generate the link using /// bot must first generate the link using
/// [`Bot::export_chat_invite_link`]. Returned only in /// [`ExportChatInviteLink`]. Returned only in
/// [`Bot::get_chat`]. /// [`GetChat`].
/// ///
/// [`Bot::export_chat_invite_link`]: /// [`ExportChatInviteLink`]:
/// crate::Bot::export_chat_invite_link /// crate::payloads::ExportChatInviteLink
/// ///
/// [`Bot::get_chat`]: crate::Bot::get_chat /// [`GetChat`]: crate::payloads::GetChat
pub invite_link: Option<String>, pub invite_link: Option<String>,
/// Pinned message, for groups, supergroups and channels. Returned only /// Pinned message, for groups, supergroups and channels. Returned only
/// in [`Bot::get_chat`]. /// in [`GetChat`].
/// ///
/// [`Bot::get_chat`]: crate::Bot::get_chat /// [`GetChat`]: crate::payloads::GetChat
pub pinned_message: Option<Box<Message>>, pub pinned_message: Option<Box<Message>>,
} }
@ -199,9 +199,9 @@ impl PublicChatChannel {
#[derive(Clone, Default, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Default, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct PublicChatGroup { pub struct PublicChatGroup {
/// A default chat member permissions, for groups and supergroups. Returned /// A default chat member permissions, for groups and supergroups. Returned
/// only from [`Bot::get_chat`]. /// only from [`GetChat`].
/// ///
/// [`Bot::get_chat`]: crate::Bot::get_chat /// [`GetChat`]: crate::payloads::GetChat
pub permissions: Option<ChatPermissions>, pub permissions: Option<ChatPermissions>,
} }
@ -219,27 +219,27 @@ pub struct PublicChatSupergroup {
pub username: Option<String>, pub username: Option<String>,
/// For supergroups, name of group sticker set. Returned only from /// For supergroups, name of group sticker set. Returned only from
/// [`Bot::get_chat`]. /// [`GetChat`].
/// ///
/// [`Bot::get_chat`]: crate::Bot::get_chat /// [`GetChat`]: crate::payloads::GetChat
pub sticker_set_name: Option<String>, pub sticker_set_name: Option<String>,
/// `true`, if the bot can change the group sticker set. Returned only /// `true`, if the bot can change the group sticker set. Returned only
/// from [`Bot::get_chat`]. /// from [`GetChat`].
/// ///
/// [`Bot::get_chat`]: crate::Bot::get_chat /// [`GetChat`]: crate::payloads::GetChat
pub can_set_sticker_set: Option<bool>, pub can_set_sticker_set: Option<bool>,
/// A default chat member permissions, for groups and supergroups. /// A default chat member permissions, for groups and supergroups.
/// Returned only from [`Bot::get_chat`]. /// Returned only from [`GetChat`].
/// ///
/// [`Bot::get_chat`]: crate::Bot::get_chat /// [`GetChat`]: crate::payloads::GetChat
pub permissions: Option<ChatPermissions>, pub permissions: Option<ChatPermissions>,
/// The minimum allowed delay between consecutive messages sent by each /// The minimum allowed delay between consecutive messages sent by each
/// unpriviledged user. Returned only from [`Bot::get_chat`]. /// unpriviledged user. Returned only from [`GetChat`].
/// ///
/// [`Bot::get_chat`]: crate::Bot::get_chat /// [`GetChat`]: crate::payloads::GetChat
pub slow_mode_delay: Option<i32>, pub slow_mode_delay: Option<i32>,
} }

View file

@ -4,11 +4,11 @@ use serde::{Deserialize, Serialize};
/// ///
/// The file can be downloaded via the link `https://api.telegram.org/file/bot<token>/<file_path>`. /// 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 /// 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 [`Bot::get_file`]. /// link expires, a new one can be requested by calling [`GetFile`].
/// ///
/// [The official docs](https://core.telegram.org/bots/api#file). /// [The official docs](https://core.telegram.org/bots/api#file).
/// ///
/// [`Bot::get_file`]: crate::Bot::get_file /// [`GetFile`]: crate::payloads::GetFile
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct File { pub struct File {
/// Identifier for this file. /// Identifier for this file.

View file

@ -20,14 +20,15 @@ pub struct Game {
/// Photo that will be displayed in the game message in chats. /// Photo that will be displayed in the game message in chats.
pub photo: Vec<PhotoSize>, pub photo: Vec<PhotoSize>,
// FIXME(waffle): SetGameScore method is missing for some reason O_o
#[allow(broken_intra_doc_links)]
/// Brief description of the game or high scores included in the game /// Brief description of the game or high scores included in the game
/// message. Can be automatically edited to include current high scores /// message. Can be automatically edited to include current high scores
/// for the game when the bot calls [`Bot::set_game_score`], or manually /// for the game when the bot calls [`SetGameScore`], or manually
/// edited using [`Bot::edit_message_text`]. 0-4096 characters. /// edited using [`EditMessageText`]. 0-4096 characters.
/// ///
/// [`Bot::set_game_score`]: crate::Bot::set_game_score /// [`SetGameScore`]: crate::payloads::SetGameScore
/// /// [`EditMessageText`]: crate::payloads::EditMessageText
/// [`Bot::edit_message_text`]: crate::Bot::edit_message_text
pub text: Option<String>, pub text: Option<String>,
/// Special entities that appear in text, such as usernames, URLs, bot /// Special entities that appear in text, such as usernames, URLs, bot

View file

@ -1,9 +1,9 @@
use crate::types::User; use crate::types::User;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Returned only in [`Bot::get_me`]. /// Returned only in [`GetMe`].
/// ///
/// [`Bot::get_me`]: crate::Bot::get_me /// [`GetMe`]: crate::payloads::GetMe
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct Me { pub struct Me {
#[serde(flatten)] #[serde(flatten)]

View file

@ -16,13 +16,11 @@ use crate::types::{
pub struct Update { pub struct Update {
/// The updates unique identifier. Update identifiers start from a certain /// The updates unique identifier. Update identifiers start from a certain
/// positive number and increase sequentially. This ID becomes especially /// positive number and increase sequentially. This ID becomes especially
/// handy if youre using [Webhooks], since it allows you to ignore /// handy if youre using webhooks, since it allows you to ignore
/// repeated updates or to restore the correct update sequence, should /// repeated updates or to restore the correct update sequence, should
/// they get out of order. If there are no new updates for at least a /// they get out of order. If there are no new updates for at least a
/// week, then identifier of the next update will be chosen randomly /// week, then identifier of the next update will be chosen randomly
/// instead of sequentially. /// instead of sequentially.
///
/// [Webhooks]: crate::Bot::set_webhook
#[serde(rename = "update_id")] #[serde(rename = "update_id")]
pub id: i32, pub id: i32,