mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-09 19:49:19 +01:00
Fix derives
This commit is contained in:
parent
ae0454a716
commit
0668987b2d
95 changed files with 112 additions and 161 deletions
|
@ -1,5 +1,3 @@
|
||||||
use serde::Serialize;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
network,
|
network,
|
||||||
requests::form_builder::FormBuilder,
|
requests::form_builder::FormBuilder,
|
||||||
|
@ -11,10 +9,8 @@ use crate::requests::{Request, ResponseResult};
|
||||||
|
|
||||||
/// Use this method to add a new sticker to a set created by the bot. Returns
|
/// Use this method to add a new sticker to a set created by the bot. Returns
|
||||||
/// True on success.
|
/// True on success.
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[derive(Debug, Clone)]
|
||||||
#[derive(Debug, Clone, Serialize)]
|
|
||||||
pub struct AddStickerToSet<'a> {
|
pub struct AddStickerToSet<'a> {
|
||||||
#[serde(skip_serializing)]
|
|
||||||
bot: &'a Bot,
|
bot: &'a Bot,
|
||||||
|
|
||||||
/// User identifier of sticker set owner
|
/// User identifier of sticker set owner
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
use serde::Serialize;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
network,
|
network,
|
||||||
requests::{form_builder::FormBuilder, Request, ResponseResult},
|
requests::{form_builder::FormBuilder, Request, ResponseResult},
|
||||||
|
@ -9,10 +7,8 @@ use crate::{
|
||||||
|
|
||||||
/// Use this method to create new sticker set owned by a user. The bot will be
|
/// Use this method to create new sticker set owned by a user. The bot will be
|
||||||
/// able to edit the created sticker set. Returns True on success.
|
/// able to edit the created sticker set. Returns True on success.
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[derive(Debug, Clone)]
|
||||||
#[derive(Debug, Clone, Serialize)]
|
|
||||||
pub struct CreateNewStickerSet<'a> {
|
pub struct CreateNewStickerSet<'a> {
|
||||||
#[serde(skip_serializing)]
|
|
||||||
bot: &'a Bot,
|
bot: &'a Bot,
|
||||||
|
|
||||||
/// User identifier of created sticker set owner
|
/// User identifier of created sticker set owner
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
use serde::Serialize;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
network,
|
network,
|
||||||
requests::{form_builder::FormBuilder, Request, ResponseResult},
|
requests::{form_builder::FormBuilder, Request, ResponseResult},
|
||||||
|
@ -14,13 +12,10 @@ use crate::{
|
||||||
/// previously uploaded file via its file_id or specify a URL. On success, if
|
/// previously uploaded file via its file_id or specify a URL. On success, if
|
||||||
/// the edited message was sent by the bot, the edited Message is returned,
|
/// the edited message was sent by the bot, the edited Message is returned,
|
||||||
/// otherwise True is returned.
|
/// otherwise True is returned.
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[derive(Debug, Clone)]
|
||||||
#[derive(Debug, Clone, Serialize)]
|
|
||||||
pub struct EditMessageMedia<'a> {
|
pub struct EditMessageMedia<'a> {
|
||||||
#[serde(skip_serializing)]
|
|
||||||
bot: &'a Bot,
|
bot: &'a Bot,
|
||||||
|
|
||||||
#[serde(flatten)]
|
|
||||||
chat_or_inline_message: ChatOrInlineMessage,
|
chat_or_inline_message: ChatOrInlineMessage,
|
||||||
|
|
||||||
/// A JSON-serialized object for a new media content of the message
|
/// A JSON-serialized object for a new media content of the message
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
use serde::Serialize;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
network,
|
network,
|
||||||
requests::{form_builder::FormBuilder, Request, ResponseResult},
|
requests::{form_builder::FormBuilder, Request, ResponseResult},
|
||||||
|
@ -14,10 +12,8 @@ use crate::{
|
||||||
///
|
///
|
||||||
/// Bots can currently send animation files of up to 50 MB in size, this limit
|
/// Bots can currently send animation files of up to 50 MB in size, this limit
|
||||||
/// may be changed in the future.
|
/// may be changed in the future.
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[derive(Debug, Clone)]
|
||||||
#[derive(Debug, Clone, Serialize)]
|
|
||||||
pub struct SendAnimation<'a> {
|
pub struct SendAnimation<'a> {
|
||||||
#[serde(skip_serializing)]
|
|
||||||
bot: &'a Bot,
|
bot: &'a Bot,
|
||||||
|
|
||||||
/// Unique identifier for the target chat or username of the target channel
|
/// Unique identifier for the target chat or username of the target channel
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
use serde::Serialize;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
network,
|
network,
|
||||||
requests::{form_builder::FormBuilder, Request, ResponseResult},
|
requests::{form_builder::FormBuilder, Request, ResponseResult},
|
||||||
|
@ -12,10 +10,8 @@ use crate::{
|
||||||
/// success, the sent Message is returned. Bots can currently send audio files
|
/// success, the sent Message is returned. Bots can currently send audio files
|
||||||
/// of up to 50 MB in size, this limit may be changed in the future.For sending
|
/// of up to 50 MB in size, this limit may be changed in the future.For sending
|
||||||
/// voice messages, use the sendVoice method instead.
|
/// voice messages, use the sendVoice method instead.
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[derive(Debug, Clone)]
|
||||||
#[derive(Debug, Clone, Serialize)]
|
|
||||||
pub struct SendAudio<'a> {
|
pub struct SendAudio<'a> {
|
||||||
#[serde(skip_serializing)]
|
|
||||||
bot: &'a Bot,
|
bot: &'a Bot,
|
||||||
|
|
||||||
/// Unique identifier for the target chat or username of the target channel
|
/// Unique identifier for the target chat or username of the target channel
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
network,
|
network,
|
||||||
|
@ -33,7 +33,7 @@ pub struct SendChatAction<'a> {
|
||||||
/// A type of action used in [`SendChatAction`].
|
/// A type of action used in [`SendChatAction`].
|
||||||
///
|
///
|
||||||
/// [`SendChatAction`]: crate::requests::SendChatAction
|
/// [`SendChatAction`]: crate::requests::SendChatAction
|
||||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, Serialize)]
|
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
pub enum SendChatActionKind {
|
pub enum SendChatActionKind {
|
||||||
/// For [text messages](crate::Bot::send_message).
|
/// For [text messages](crate::Bot::send_message).
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
use serde::Serialize;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
network,
|
network,
|
||||||
requests::{form_builder::FormBuilder, Request, ResponseResult},
|
requests::{form_builder::FormBuilder, Request, ResponseResult},
|
||||||
|
@ -10,10 +8,8 @@ use crate::{
|
||||||
/// Use this method to send general files. On success, the sent Message is
|
/// Use this method to send general files. On success, the sent Message is
|
||||||
/// returned. Bots can currently send files of any type of up to 50 MB in size,
|
/// returned. Bots can currently send files of any type of up to 50 MB in size,
|
||||||
/// this limit may be changed in the future.
|
/// this limit may be changed in the future.
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[derive(Debug, Clone)]
|
||||||
#[derive(Debug, Clone, Serialize)]
|
|
||||||
pub struct SendDocument<'a> {
|
pub struct SendDocument<'a> {
|
||||||
#[serde(skip_serializing)]
|
|
||||||
bot: &'a Bot,
|
bot: &'a Bot,
|
||||||
|
|
||||||
/// Unique identifier for the target chat or username of the target channel
|
/// Unique identifier for the target chat or username of the target channel
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
use serde::Serialize;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
network,
|
network,
|
||||||
requests::{form_builder::FormBuilder, Request, ResponseResult},
|
requests::{form_builder::FormBuilder, Request, ResponseResult},
|
||||||
|
@ -9,10 +7,8 @@ use crate::{
|
||||||
|
|
||||||
/// Use this method to send a group of photos or videos as an album. On success,
|
/// Use this method to send a group of photos or videos as an album. On success,
|
||||||
/// an array of the sent Messages is returned.
|
/// an array of the sent Messages is returned.
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[derive(Debug, Clone)]
|
||||||
#[derive(Debug, Clone, Serialize)]
|
|
||||||
pub struct SendMediaGroup<'a> {
|
pub struct SendMediaGroup<'a> {
|
||||||
#[serde(skip_serializing)]
|
|
||||||
bot: &'a Bot,
|
bot: &'a Bot,
|
||||||
|
|
||||||
/// Unique identifier for the target chat or username of the target channel
|
/// Unique identifier for the target chat or username of the target channel
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
use serde::Serialize;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
network,
|
network,
|
||||||
requests::{form_builder::FormBuilder, Request, ResponseResult},
|
requests::{form_builder::FormBuilder, Request, ResponseResult},
|
||||||
|
@ -8,10 +6,8 @@ use crate::{
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Use this method to send photos. On success, the sent Message is returned.
|
/// Use this method to send photos. On success, the sent Message is returned.
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[derive(Debug, Clone)]
|
||||||
#[derive(Debug, Clone, Serialize)]
|
|
||||||
pub struct SendPhoto<'a> {
|
pub struct SendPhoto<'a> {
|
||||||
#[serde(skip_serializing)]
|
|
||||||
bot: &'a Bot,
|
bot: &'a Bot,
|
||||||
|
|
||||||
/// Unique identifier for the target chat or username of the target channel
|
/// Unique identifier for the target chat or username of the target channel
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
use serde::Serialize;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
network,
|
network,
|
||||||
requests::{form_builder::FormBuilder, Request, ResponseResult},
|
requests::{form_builder::FormBuilder, Request, ResponseResult},
|
||||||
|
@ -9,10 +7,8 @@ use crate::{
|
||||||
|
|
||||||
/// Use this method to send static .WEBP or animated .TGS stickers. On success,
|
/// Use this method to send static .WEBP or animated .TGS stickers. On success,
|
||||||
/// the sent Message is returned.
|
/// the sent Message is returned.
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[derive(Debug, Clone)]
|
||||||
#[derive(Debug, Clone, Serialize)]
|
|
||||||
pub struct SendSticker<'a> {
|
pub struct SendSticker<'a> {
|
||||||
#[serde(skip_serializing)]
|
|
||||||
bot: &'a Bot,
|
bot: &'a Bot,
|
||||||
|
|
||||||
/// Unique identifier for the target chat or username of the target channel
|
/// Unique identifier for the target chat or username of the target channel
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
use serde::Serialize;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
network,
|
network,
|
||||||
requests::{form_builder::FormBuilder, Request, ResponseResult},
|
requests::{form_builder::FormBuilder, Request, ResponseResult},
|
||||||
|
@ -11,10 +9,8 @@ use crate::{
|
||||||
/// (other formats may be sent as Document). On success, the sent Message is
|
/// (other formats may be sent as Document). On success, the sent Message is
|
||||||
/// returned. Bots can currently send video files of up to 50 MB in size, this
|
/// returned. Bots can currently send video files of up to 50 MB in size, this
|
||||||
/// limit may be changed in the future.
|
/// limit may be changed in the future.
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[derive(Debug, Clone)]
|
||||||
#[derive(Debug, Clone, Serialize)]
|
|
||||||
pub struct SendVideo<'a> {
|
pub struct SendVideo<'a> {
|
||||||
#[serde(skip_serializing)]
|
|
||||||
bot: &'a Bot,
|
bot: &'a Bot,
|
||||||
|
|
||||||
/// Unique identifier for the target chat or username of the target channel
|
/// Unique identifier for the target chat or username of the target channel
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
use serde::Serialize;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
network,
|
network,
|
||||||
requests::{form_builder::FormBuilder, Request, ResponseResult},
|
requests::{form_builder::FormBuilder, Request, ResponseResult},
|
||||||
|
@ -10,10 +8,8 @@ use crate::{
|
||||||
/// As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1
|
/// As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1
|
||||||
/// minute long. Use this method to send video messages. On success, the sent
|
/// minute long. Use this method to send video messages. On success, the sent
|
||||||
/// Message is returned.
|
/// Message is returned.
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[derive(Debug, Clone)]
|
||||||
#[derive(Debug, Clone, Serialize)]
|
|
||||||
pub struct SendVideoNote<'a> {
|
pub struct SendVideoNote<'a> {
|
||||||
#[serde(skip_serializing)]
|
|
||||||
bot: &'a Bot,
|
bot: &'a Bot,
|
||||||
|
|
||||||
/// Unique identifier for the target chat or username of the target channel
|
/// Unique identifier for the target chat or username of the target channel
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
use serde::Serialize;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
network,
|
network,
|
||||||
requests::{form_builder::FormBuilder, Request, ResponseResult},
|
requests::{form_builder::FormBuilder, Request, ResponseResult},
|
||||||
|
@ -13,10 +11,8 @@ use crate::{
|
||||||
/// Document). On success, the sent Message is returned. Bots can currently send
|
/// Document). On success, the sent Message is returned. Bots can currently send
|
||||||
/// voice messages of up to 50 MB in size, this limit may be changed in the
|
/// voice messages of up to 50 MB in size, this limit may be changed in the
|
||||||
/// future.
|
/// future.
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[derive(Debug, Clone)]
|
||||||
#[derive(Debug, Clone, Serialize)]
|
|
||||||
pub struct SendVoice<'a> {
|
pub struct SendVoice<'a> {
|
||||||
#[serde(skip_serializing)]
|
|
||||||
bot: &'a Bot,
|
bot: &'a Bot,
|
||||||
|
|
||||||
/// Unique identifier for the target chat or username of the target channel
|
/// Unique identifier for the target chat or username of the target channel
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy, Deserialize, Serialize)]
|
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
pub enum AllowedUpdate {
|
pub enum AllowedUpdate {
|
||||||
Message,
|
Message,
|
||||||
|
|
|
@ -7,7 +7,7 @@ use crate::types::PhotoSize;
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#animation).
|
/// [The official docs](https://core.telegram.org/bots/api#animation).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Animation {
|
pub struct Animation {
|
||||||
/// An identifier for this file.
|
/// An identifier for this file.
|
||||||
pub file_id: String,
|
pub file_id: String,
|
||||||
|
|
|
@ -7,7 +7,7 @@ use crate::types::PhotoSize;
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#audio).
|
/// [The official docs](https://core.telegram.org/bots/api#audio).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Audio {
|
pub struct Audio {
|
||||||
/// An identifier for this file.
|
/// An identifier for this file.
|
||||||
pub file_id: String,
|
pub file_id: String,
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
/// A placeholder, currently holds no information. Use [@BotFather](https://t.me/botfather) to set up your game.
|
/// A placeholder, currently holds no information. Use [@BotFather](https://t.me/botfather) to set up your game.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#callbackgame).
|
/// [The official docs](https://core.telegram.org/bots/api#callbackgame).
|
||||||
// TODO: derives?
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct CallbackGame;
|
pub struct CallbackGame;
|
||||||
|
|
|
@ -14,7 +14,7 @@ use crate::types::{Message, User};
|
||||||
/// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
|
/// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
|
||||||
/// [inline mode]: https://core.telegram.org/bots/api#inline-mode
|
/// [inline mode]: https://core.telegram.org/bots/api#inline-mode
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct CallbackQuery {
|
pub struct CallbackQuery {
|
||||||
/// An unique identifier for this query.
|
/// An unique identifier for this query.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -6,7 +6,7 @@ use crate::types::{ChatPermissions, ChatPhoto, Message};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#chat).
|
/// [The official docs](https://core.telegram.org/bots/api#chat).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Chat {
|
pub struct Chat {
|
||||||
/// A unique identifier for this chat. This number may be greater than 32
|
/// A unique identifier for this chat. This number may be greater than 32
|
||||||
/// bits and some programming languages may have difficulty/silent defects
|
/// bits and some programming languages may have difficulty/silent defects
|
||||||
|
@ -25,7 +25,7 @@ pub struct Chat {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum ChatKind {
|
pub enum ChatKind {
|
||||||
NonPrivate {
|
NonPrivate {
|
||||||
|
@ -79,7 +79,7 @@ pub enum ChatKind {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
pub enum NonPrivateChatKind {
|
pub enum NonPrivateChatKind {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
pub enum ChatAction {
|
pub enum ChatAction {
|
||||||
Typing,
|
Typing,
|
||||||
|
|
|
@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
|
||||||
/// A unique identifier for the target chat or username of the target channel
|
/// A unique identifier for the target chat or username of the target channel
|
||||||
/// (in the format `@channelusername`).
|
/// (in the format `@channelusername`).
|
||||||
#[derive(
|
#[derive(
|
||||||
Debug, Display, PartialEq, Eq, Hash, Clone, Deserialize, Serialize, From,
|
Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Display, From,
|
||||||
)]
|
)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum ChatId {
|
pub enum ChatId {
|
||||||
|
|
|
@ -6,7 +6,7 @@ use crate::types::User;
|
||||||
/// This object contains information about one member of the chat.
|
/// This object contains information about one member of the chat.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#chatmember).
|
/// [The official docs](https://core.telegram.org/bots/api#chatmember).
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct ChatMember {
|
pub struct ChatMember {
|
||||||
/// Information about the user.
|
/// Information about the user.
|
||||||
pub user: User,
|
pub user: User,
|
||||||
|
@ -76,7 +76,7 @@ pub struct ChatMember {
|
||||||
pub can_add_web_page_previews: Option<bool>,
|
pub can_add_web_page_previews: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
pub enum ChatMemberStatus {
|
pub enum ChatMemberStatus {
|
||||||
Creator,
|
Creator,
|
||||||
|
|
|
@ -3,7 +3,7 @@ use crate::types::ChatId;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
/// A chat message or inline message.
|
/// A chat message or inline message.
|
||||||
#[derive(Serialize, Deserialize, Clone, Eq, Hash, PartialEq, Debug)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum ChatOrInlineMessage {
|
pub enum ChatOrInlineMessage {
|
||||||
Chat { chat_id: ChatId, message_id: i32 },
|
Chat { chat_id: ChatId, message_id: i32 },
|
||||||
|
|
|
@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#chatpermissions).
|
/// [The official docs](https://core.telegram.org/bots/api#chatpermissions).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct ChatPermissions {
|
pub struct ChatPermissions {
|
||||||
/// `true`, if the user is allowed to send text messages, contacts,
|
/// `true`, if the user is allowed to send text messages, contacts,
|
||||||
/// locations and venues.
|
/// locations and venues.
|
||||||
|
|
|
@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
|
||||||
/// This object represents a chat photo.
|
/// This object represents a chat photo.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#chatphoto).
|
/// [The official docs](https://core.telegram.org/bots/api#chatphoto).
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct ChatPhoto {
|
pub struct ChatPhoto {
|
||||||
/// A file identifier of small (160x160) chat photo. This file_id can be
|
/// A file identifier of small (160x160) chat photo. This file_id can be
|
||||||
/// used only for photo download and only for as long as the photo is
|
/// used only for photo download and only for as long as the photo is
|
||||||
|
|
|
@ -9,7 +9,7 @@ use crate::types::{Location, User};
|
||||||
///
|
///
|
||||||
/// [result]: https://core.telegram.org/bots/api#inlinequeryresult
|
/// [result]: https://core.telegram.org/bots/api#inlinequeryresult
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct ChosenInlineResult {
|
pub struct ChosenInlineResult {
|
||||||
/// The unique identifier for the result that was chosen.
|
/// The unique identifier for the result that was chosen.
|
||||||
pub result_id: String,
|
pub result_id: String,
|
||||||
|
|
|
@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#contact).
|
/// [The official docs](https://core.telegram.org/bots/api#contact).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Contact {
|
pub struct Contact {
|
||||||
/// A contact's phone number.
|
/// A contact's phone number.
|
||||||
pub phone_number: String,
|
pub phone_number: String,
|
||||||
|
|
|
@ -11,7 +11,7 @@ use crate::types::PhotoSize;
|
||||||
/// [voice messages]: https://core.telegram.org/bots/api#voice
|
/// [voice messages]: https://core.telegram.org/bots/api#voice
|
||||||
/// [audio files]: https://core.telegram.org/bots/api#audio
|
/// [audio files]: https://core.telegram.org/bots/api#audio
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Document {
|
pub struct Document {
|
||||||
/// An identifier for this file.
|
/// An identifier for this file.
|
||||||
pub file_id: String,
|
pub file_id: String,
|
||||||
|
|
|
@ -10,7 +10,7 @@ use serde::{Deserialize, Serialize};
|
||||||
/// crate::types::EncryptedPassportElement
|
/// crate::types::EncryptedPassportElement
|
||||||
/// [Telegram Passport Documentation]: https://core.telegram.org/passport#receiving-information
|
/// [Telegram Passport Documentation]: https://core.telegram.org/passport#receiving-information
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct EncryptedCredentials {
|
pub struct EncryptedCredentials {
|
||||||
/// Base64-encoded encrypted JSON-serialized data with unique user's
|
/// Base64-encoded encrypted JSON-serialized data with unique user's
|
||||||
/// payload, data hashes and secrets required for
|
/// payload, data hashes and secrets required for
|
||||||
|
|
|
@ -6,7 +6,7 @@ use super::PassportFile;
|
||||||
/// shared with the bot by the user.
|
/// shared with the bot by the user.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#encryptedpassportelement).
|
/// [The official docs](https://core.telegram.org/bots/api#encryptedpassportelement).
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct EncryptedPassportElement {
|
pub struct EncryptedPassportElement {
|
||||||
/// Base64-encoded element hash for using in
|
/// Base64-encoded element hash for using in
|
||||||
/// [`PassportElementErrorUnspecified`].
|
/// [`PassportElementErrorUnspecified`].
|
||||||
|
@ -20,7 +20,7 @@ pub struct EncryptedPassportElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
#[allow(clippy::large_enum_variant)]
|
#[allow(clippy::large_enum_variant)]
|
||||||
pub enum EncryptedPassportElementKind {
|
pub enum EncryptedPassportElementKind {
|
||||||
|
|
|
@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize};
|
||||||
/// [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
|
/// [`Bot::get_file`]: crate::Bot::get_file
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct File {
|
pub struct File {
|
||||||
/// Identifier for this file.
|
/// Identifier for this file.
|
||||||
pub file_id: String,
|
pub file_id: String,
|
||||||
|
|
|
@ -12,7 +12,7 @@ use crate::types::True;
|
||||||
///
|
///
|
||||||
/// [privacy mode]: https://core.telegram.org/bots#privacy-mode
|
/// [privacy mode]: https://core.telegram.org/bots#privacy-mode
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct ForceReply {
|
pub struct ForceReply {
|
||||||
/// Shows reply interface to the user, as if they manually selected the
|
/// Shows reply interface to the user, as if they manually selected the
|
||||||
/// bot‘s message and tapped ’Reply'.
|
/// bot‘s message and tapped ’Reply'.
|
||||||
|
|
|
@ -7,7 +7,7 @@ use crate::types::{Animation, MessageEntity, PhotoSize};
|
||||||
///
|
///
|
||||||
/// [@Botfather]: https://t.me/botfather
|
/// [@Botfather]: https://t.me/botfather
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Game {
|
pub struct Game {
|
||||||
/// Title of the game.
|
/// Title of the game.
|
||||||
pub title: String,
|
pub title: String,
|
||||||
|
|
|
@ -5,7 +5,7 @@ use crate::types::user::User;
|
||||||
/// This object represents one row of the high scores table for a game.
|
/// This object represents one row of the high scores table for a game.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#gamehighscore).
|
/// [The official docs](https://core.telegram.org/bots/api#gamehighscore).
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct GameHighScore {
|
pub struct GameHighScore {
|
||||||
/// Position in high score table for the game.
|
/// Position in high score table for the game.
|
||||||
pub position: u32,
|
pub position: u32,
|
||||||
|
|
|
@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
|
||||||
/// This object represents one button of an inline keyboard.
|
/// This object represents one button of an inline keyboard.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinekeyboardbutton).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinekeyboardbutton).
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InlineKeyboardButton {
|
pub struct InlineKeyboardButton {
|
||||||
/// Label text on the button.
|
/// Label text on the button.
|
||||||
pub text: String,
|
pub text: String,
|
||||||
|
@ -12,9 +12,7 @@ pub struct InlineKeyboardButton {
|
||||||
pub kind: InlineKeyboardButtonKind,
|
pub kind: InlineKeyboardButtonKind,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
Debug, Clone, PartialEq, PartialOrd, Serialize, Eq, Hash, Deserialize,
|
|
||||||
)]
|
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
pub enum InlineKeyboardButtonKind {
|
pub enum InlineKeyboardButtonKind {
|
||||||
/// HTTP or tg:// url to be opened when button is pressed.
|
/// HTTP or tg:// url to be opened when button is pressed.
|
||||||
|
|
|
@ -11,7 +11,7 @@ use crate::types::InlineKeyboardButton;
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinekeyboardmarkup).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinekeyboardmarkup).
|
||||||
///
|
///
|
||||||
/// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
|
/// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize, Default)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Default)]
|
||||||
pub struct InlineKeyboardMarkup {
|
pub struct InlineKeyboardMarkup {
|
||||||
/// Array of button rows, each represented by an array of
|
/// Array of button rows, each represented by an array of
|
||||||
/// [`InlineKeyboardButton`] objects.
|
/// [`InlineKeyboardButton`] objects.
|
||||||
|
|
|
@ -7,7 +7,7 @@ use crate::types::{Location, User};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinequery).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinequery).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InlineQuery {
|
pub struct InlineQuery {
|
||||||
/// Unique identifier for this query.
|
/// Unique identifier for this query.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -18,7 +18,7 @@ use crate::types::{
|
||||||
/// This object represents one result of an inline query.
|
/// This object represents one result of an inline query.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresult).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresult).
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize, From)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, From)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
pub enum InlineQueryResult {
|
pub enum InlineQueryResult {
|
||||||
|
|
|
@ -6,7 +6,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultarticle).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultarticle).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InlineQueryResultArticle {
|
pub struct InlineQueryResultArticle {
|
||||||
/// Unique identifier for this result, 1-64 Bytes.
|
/// Unique identifier for this result, 1-64 Bytes.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -8,7 +8,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultaudio).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultaudio).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InlineQueryResultAudio {
|
pub struct InlineQueryResultAudio {
|
||||||
/// Unique identifier for this result, 1-64 bytes.
|
/// Unique identifier for this result, 1-64 bytes.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedaudio).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedaudio).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InlineQueryResultCachedAudio {
|
pub struct InlineQueryResultCachedAudio {
|
||||||
/// Unique identifier for this result, 1-64 bytes.
|
/// Unique identifier for this result, 1-64 bytes.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcacheddocument).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcacheddocument).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InlineQueryResultCachedDocument {
|
pub struct InlineQueryResultCachedDocument {
|
||||||
/// Unique identifier for this result, 1-64 bytes.
|
/// Unique identifier for this result, 1-64 bytes.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedgif).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedgif).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InlineQueryResultCachedGif {
|
pub struct InlineQueryResultCachedGif {
|
||||||
/// Unique identifier for this result, 1-64 bytes.
|
/// Unique identifier for this result, 1-64 bytes.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -10,7 +10,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedmpeg4gif).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedmpeg4gif).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InlineQueryResultCachedMpeg4Gif {
|
pub struct InlineQueryResultCachedMpeg4Gif {
|
||||||
/// Unique identifier for this result, 1-64 bytes.
|
/// Unique identifier for this result, 1-64 bytes.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedphoto).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedphoto).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InlineQueryResultCachedPhoto {
|
pub struct InlineQueryResultCachedPhoto {
|
||||||
/// Unique identifier for this result, 1-64 bytes.
|
/// Unique identifier for this result, 1-64 bytes.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedsticker).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedsticker).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InlineQueryResultCachedSticker {
|
pub struct InlineQueryResultCachedSticker {
|
||||||
/// Unique identifier for this result, 1-64 bytes.
|
/// Unique identifier for this result, 1-64 bytes.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedvideo).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedvideo).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InlineQueryResultCachedVideo {
|
pub struct InlineQueryResultCachedVideo {
|
||||||
/// Unique identifier for this result, 1-64 bytes.
|
/// Unique identifier for this result, 1-64 bytes.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedvideo).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedvideo).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InlineQueryResultCachedVoice {
|
pub struct InlineQueryResultCachedVoice {
|
||||||
/// Unique identifier for this result, 1-64 bytes.
|
/// Unique identifier for this result, 1-64 bytes.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -8,7 +8,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedvideo).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedvideo).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InlineQueryResultContact {
|
pub struct InlineQueryResultContact {
|
||||||
/// Unique identifier for this result, 1-64 Bytes.
|
/// Unique identifier for this result, 1-64 Bytes.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultdocument).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultdocument).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InlineQueryResultDocument {
|
pub struct InlineQueryResultDocument {
|
||||||
/// Unique identifier for this result, 1-64 bytes.
|
/// Unique identifier for this result, 1-64 bytes.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -8,7 +8,7 @@ use crate::types::InlineKeyboardMarkup;
|
||||||
///
|
///
|
||||||
/// [game]: https://core.telegram.org/bots/api#games
|
/// [game]: https://core.telegram.org/bots/api#games
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InlineQueryResultGame {
|
pub struct InlineQueryResultGame {
|
||||||
/// Unique identifier for this result, 1-64 bytes.
|
/// Unique identifier for this result, 1-64 bytes.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultgif).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultgif).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InlineQueryResultGif {
|
pub struct InlineQueryResultGif {
|
||||||
/// Unique identifier for this result, 1-64 bytes.
|
/// Unique identifier for this result, 1-64 bytes.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -8,7 +8,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultlocation).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultlocation).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InlineQueryResultLocation {
|
pub struct InlineQueryResultLocation {
|
||||||
/// Unique identifier for this result, 1-64 Bytes.
|
/// Unique identifier for this result, 1-64 Bytes.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultmpeg4gif).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultmpeg4gif).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InlineQueryResultMpeg4Gif {
|
pub struct InlineQueryResultMpeg4Gif {
|
||||||
/// Unique identifier for this result, 1-64 bytes.
|
/// Unique identifier for this result, 1-64 bytes.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultphoto).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultphoto).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InlineQueryResultPhoto {
|
pub struct InlineQueryResultPhoto {
|
||||||
/// Unique identifier for this result, 1-64 bytes.
|
/// Unique identifier for this result, 1-64 bytes.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -8,7 +8,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultvenue).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultvenue).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InlineQueryResultVenue {
|
pub struct InlineQueryResultVenue {
|
||||||
/// Unique identifier for this result, 1-64 Bytes.
|
/// Unique identifier for this result, 1-64 Bytes.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultvideo).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultvideo).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InlineQueryResultVideo {
|
pub struct InlineQueryResultVideo {
|
||||||
/// Unique identifier for this result, 1-64 bytes.
|
/// Unique identifier for this result, 1-64 bytes.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultvoice).
|
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultvoice).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct InlineQueryResultVoice {
|
pub struct InlineQueryResultVoice {
|
||||||
/// Unique identifier for this result, 1-64 bytes.
|
/// Unique identifier for this result, 1-64 bytes.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -5,7 +5,7 @@ use std::path::PathBuf;
|
||||||
/// This object represents the contents of a file to be uploaded.
|
/// This object represents the contents of a file to be uploaded.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#inputfile).
|
/// [The official docs](https://core.telegram.org/bots/api#inputfile).
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Deserialize)]
|
||||||
pub enum InputFile {
|
pub enum InputFile {
|
||||||
File(PathBuf),
|
File(PathBuf),
|
||||||
Url(String),
|
Url(String),
|
||||||
|
|
|
@ -4,7 +4,7 @@ use crate::types::{InputFile, ParseMode};
|
||||||
|
|
||||||
// TODO: should variants use new-type?
|
// TODO: should variants use new-type?
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
/// This object represents the content of a media message to be sent.
|
/// This object represents the content of a media message to be sent.
|
||||||
|
|
|
@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
|
||||||
use crate::types::ParseMode;
|
use crate::types::ParseMode;
|
||||||
|
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
/// This object represents the content of a message to be sent as a result of an
|
/// This object represents the content of a message to be sent as a result of an
|
||||||
/// inline query.
|
/// inline query.
|
||||||
|
|
|
@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
|
||||||
/// This object contains basic information about an invoice.
|
/// This object contains basic information about an invoice.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#invoice).
|
/// [The official docs](https://core.telegram.org/bots/api#invoice).
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Invoice {
|
pub struct Invoice {
|
||||||
/// Product name.
|
/// Product name.
|
||||||
pub title: String,
|
pub title: String,
|
||||||
|
|
|
@ -8,7 +8,7 @@ use crate::types::True;
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#keyboardbutton).
|
/// [The official docs](https://core.telegram.org/bots/api#keyboardbutton).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Hash, PartialEq, Eq, Clone)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct KeyboardButton {
|
pub struct KeyboardButton {
|
||||||
/// Text of the button. If none of the optional fields are used, it will
|
/// Text of the button. If none of the optional fields are used, it will
|
||||||
/// be sent as a message when the button is pressed.
|
/// be sent as a message when the button is pressed.
|
||||||
|
@ -24,7 +24,7 @@ pub struct KeyboardButton {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Serialize + Deserialize are implemented by hand
|
// Serialize + Deserialize are implemented by hand
|
||||||
#[derive(Debug, Hash, PartialEq, Eq, Clone)]
|
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)]
|
||||||
pub enum ButtonRequest {
|
pub enum ButtonRequest {
|
||||||
Location,
|
Location,
|
||||||
Contact,
|
Contact,
|
||||||
|
|
|
@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
|
||||||
/// This object represents a portion of the price for goods or services.
|
/// This object represents a portion of the price for goods or services.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#labeledprice).
|
/// [The official docs](https://core.telegram.org/bots/api#labeledprice).
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct LabeledPrice {
|
pub struct LabeledPrice {
|
||||||
/// Portion label.
|
/// Portion label.
|
||||||
pub label: String,
|
pub label: String,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
/// This object represents a point on the map.
|
/// This object represents a point on the map.
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Location {
|
pub struct Location {
|
||||||
/// Longitude as defined by sender.
|
/// Longitude as defined by sender.
|
||||||
pub longitude: f64,
|
pub longitude: f64,
|
||||||
|
|
|
@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize};
|
||||||
///
|
///
|
||||||
/// [Telegram Login Widget]: https://core.telegram.org/widgets/login
|
/// [Telegram Login Widget]: https://core.telegram.org/widgets/login
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct LoginUrl {
|
pub struct LoginUrl {
|
||||||
pub url: String,
|
pub url: String,
|
||||||
pub forward_text: Option<String>,
|
pub forward_text: Option<String>,
|
||||||
|
|
|
@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
|
||||||
/// default.
|
/// default.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#maskposition).
|
/// [The official docs](https://core.telegram.org/bots/api#maskposition).
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct MaskPosition {
|
pub struct MaskPosition {
|
||||||
/// The part of the face relative to which the mask should be placed. One
|
/// The part of the face relative to which the mask should be placed. One
|
||||||
/// of `forehead`, `eyes`, `mouth`, or `chin`.
|
/// of `forehead`, `eyes`, `mouth`, or `chin`.
|
||||||
|
|
|
@ -11,7 +11,7 @@ use crate::types::{
|
||||||
/// This object represents a message.
|
/// This object represents a message.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#message).
|
/// [The official docs](https://core.telegram.org/bots/api#message).
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Message {
|
pub struct Message {
|
||||||
/// Unique message identifier inside this chat.
|
/// Unique message identifier inside this chat.
|
||||||
#[serde(rename = "message_id")]
|
#[serde(rename = "message_id")]
|
||||||
|
@ -28,7 +28,7 @@ pub struct Message {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum MessageKind {
|
pub enum MessageKind {
|
||||||
Common {
|
Common {
|
||||||
|
@ -143,7 +143,7 @@ pub enum MessageKind {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub enum Sender {
|
pub enum Sender {
|
||||||
/// Sender of a message from chat.
|
/// Sender of a message from chat.
|
||||||
#[serde(rename = "from")]
|
#[serde(rename = "from")]
|
||||||
|
@ -154,7 +154,7 @@ pub enum Sender {
|
||||||
Signature(String),
|
Signature(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub enum ForwardedFrom {
|
pub enum ForwardedFrom {
|
||||||
#[serde(rename = "forward_from")]
|
#[serde(rename = "forward_from")]
|
||||||
User(User),
|
User(User),
|
||||||
|
@ -162,7 +162,7 @@ pub enum ForwardedFrom {
|
||||||
SenderName(String),
|
SenderName(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum ForwardKind {
|
pub enum ForwardKind {
|
||||||
ChannelForward {
|
ChannelForward {
|
||||||
|
@ -186,7 +186,7 @@ pub enum ForwardKind {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum MediaKind {
|
pub enum MediaKind {
|
||||||
Animation {
|
Animation {
|
||||||
|
|
|
@ -6,7 +6,7 @@ use crate::types::User;
|
||||||
/// hashtags, usernames, URLs, etc.
|
/// hashtags, usernames, URLs, etc.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#messageentity).
|
/// [The official docs](https://core.telegram.org/bots/api#messageentity).
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct MessageEntity {
|
pub struct MessageEntity {
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
pub kind: MessageEntityKind,
|
pub kind: MessageEntityKind,
|
||||||
|
@ -18,7 +18,7 @@ pub struct MessageEntity {
|
||||||
pub length: usize,
|
pub length: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
pub enum MessageEntityKind {
|
pub enum MessageEntityKind {
|
||||||
|
|
|
@ -5,7 +5,7 @@ use crate::types::ShippingAddress;
|
||||||
/// This object represents information about an order.
|
/// This object represents information about an order.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#orderinfo).
|
/// [The official docs](https://core.telegram.org/bots/api#orderinfo).
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct OrderInfo {
|
pub struct OrderInfo {
|
||||||
/// User's name.
|
/// User's name.
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
|
|
@ -124,7 +124,7 @@ use serde::{Deserialize, Serialize};
|
||||||
/// [`MarkdownV2`]: ParseMode::MarkdownV2
|
/// [`MarkdownV2`]: ParseMode::MarkdownV2
|
||||||
/// [`HTML`]: ParseMode::HTML
|
/// [`HTML`]: ParseMode::HTML
|
||||||
/// [`Markdown`]: ParseMode::Markdown
|
/// [`Markdown`]: ParseMode::Markdown
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub enum ParseMode {
|
pub enum ParseMode {
|
||||||
MarkdownV2,
|
MarkdownV2,
|
||||||
HTML,
|
HTML,
|
||||||
|
|
|
@ -6,7 +6,7 @@ use super::{EncryptedCredentials, EncryptedPassportElement};
|
||||||
/// user.
|
/// user.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#passportdata).
|
/// [The official docs](https://core.telegram.org/bots/api#passportdata).
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct PassportData {
|
pub struct PassportData {
|
||||||
/// Array with information about documents and other Telegram Passport
|
/// Array with information about documents and other Telegram Passport
|
||||||
/// elements that was shared with the bot.
|
/// elements that was shared with the bot.
|
||||||
|
|
|
@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};
|
||||||
/// 10MB.
|
/// 10MB.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#passportfile).
|
/// [The official docs](https://core.telegram.org/bots/api#passportfile).
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct PassportFile {
|
pub struct PassportFile {
|
||||||
/// Identifier for this file.
|
/// Identifier for this file.
|
||||||
pub file_id: String,
|
pub file_id: String,
|
||||||
|
|
|
@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};
|
||||||
/// [file]: crate::types::Document
|
/// [file]: crate::types::Document
|
||||||
/// [sticker]: crate::types::Sticker
|
/// [sticker]: crate::types::Sticker
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct PhotoSize {
|
pub struct PhotoSize {
|
||||||
/// Identifier for this file.
|
/// Identifier for this file.
|
||||||
pub file_id: String,
|
pub file_id: String,
|
||||||
|
|
|
@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
|
||||||
/// This object contains information about a poll.
|
/// This object contains information about a poll.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#poll).
|
/// [The official docs](https://core.telegram.org/bots/api#poll).
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Poll {
|
pub struct Poll {
|
||||||
/// Unique poll identifier.
|
/// Unique poll identifier.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
@ -21,7 +21,7 @@ pub struct Poll {
|
||||||
/// This object contains information about one answer option in a poll.
|
/// This object contains information about one answer option in a poll.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#polloption).
|
/// [The official docs](https://core.telegram.org/bots/api#polloption).
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct PollOption {
|
pub struct PollOption {
|
||||||
/// Option text, 1-100 characters.
|
/// Option text, 1-100 characters.
|
||||||
pub text: String,
|
pub text: String,
|
||||||
|
|
|
@ -6,7 +6,7 @@ use crate::types::{OrderInfo, User};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#precheckoutquery).
|
/// [The official docs](https://core.telegram.org/bots/api#precheckoutquery).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct PreCheckoutQuery {
|
pub struct PreCheckoutQuery {
|
||||||
/// Unique query identifier.
|
/// Unique query identifier.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -10,7 +10,7 @@ use crate::types::KeyboardButton;
|
||||||
/// [custom keyboard]: https://core.telegram.org/bots#keyboards
|
/// [custom keyboard]: https://core.telegram.org/bots#keyboards
|
||||||
/// [Introduction to bots]: https://core.telegram.org/bots#keyboards
|
/// [Introduction to bots]: https://core.telegram.org/bots#keyboards
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct ReplyKeyboardMarkup {
|
pub struct ReplyKeyboardMarkup {
|
||||||
/// Array of button rows, each represented by an Array of
|
/// Array of button rows, each represented by an Array of
|
||||||
/// [`KeyboardButton`] objects
|
/// [`KeyboardButton`] objects
|
||||||
|
|
|
@ -12,7 +12,7 @@ use crate::types::True;
|
||||||
///
|
///
|
||||||
/// [`ReplyKeyboardMarkup`]: crate::types::ReplyKeyboardMarkup
|
/// [`ReplyKeyboardMarkup`]: crate::types::ReplyKeyboardMarkup
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct ReplyKeyboardRemove {
|
pub struct ReplyKeyboardRemove {
|
||||||
/// Requests clients to remove the custom keyboard (user will not be able
|
/// Requests clients to remove the custom keyboard (user will not be able
|
||||||
/// to summon this keyboard; if you want to hide the keyboard from sight
|
/// to summon this keyboard; if you want to hide the keyboard from sight
|
||||||
|
|
|
@ -4,7 +4,7 @@ use crate::types::{
|
||||||
ForceReply, InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove,
|
ForceReply, InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum ReplyMarkup {
|
pub enum ReplyMarkup {
|
||||||
Inline(InlineKeyboardMarkup),
|
Inline(InlineKeyboardMarkup),
|
||||||
|
|
|
@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
|
||||||
/// Contains information about why a request was unsuccessful.
|
/// Contains information about why a request was unsuccessful.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#responseparameters).
|
/// [The official docs](https://core.telegram.org/bots/api#responseparameters).
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
pub enum ResponseParameters {
|
pub enum ResponseParameters {
|
||||||
/// The group has been migrated to a supergroup with the specified
|
/// The group has been migrated to a supergroup with the specified
|
||||||
|
|
|
@ -4,7 +4,7 @@ use crate::types::{ChatId, InlineKeyboardMarkup, LabeledPrice};
|
||||||
|
|
||||||
// TODO: missing docs
|
// TODO: missing docs
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct SendInvoice {
|
pub struct SendInvoice {
|
||||||
pub chat_id: ChatId,
|
pub chat_id: ChatId,
|
||||||
pub title: String,
|
pub title: String,
|
||||||
|
|
|
@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
|
||||||
/// This object represents a shipping address.
|
/// This object represents a shipping address.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#shippingaddress).
|
/// [The official docs](https://core.telegram.org/bots/api#shippingaddress).
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct ShippingAddress {
|
pub struct ShippingAddress {
|
||||||
/// ISO 3166-1 alpha-2 country code.
|
/// ISO 3166-1 alpha-2 country code.
|
||||||
pub country_code: String,
|
pub country_code: String,
|
||||||
|
|
|
@ -5,7 +5,7 @@ use crate::types::LabeledPrice;
|
||||||
/// This object represents one shipping option.
|
/// This object represents one shipping option.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#shippingoption).
|
/// [The official docs](https://core.telegram.org/bots/api#shippingoption).
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct ShippingOption {
|
pub struct ShippingOption {
|
||||||
/// Shipping option identifier.
|
/// Shipping option identifier.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -5,7 +5,7 @@ use crate::types::{ShippingAddress, User};
|
||||||
/// This object contains information about an incoming shipping query.
|
/// This object contains information about an incoming shipping query.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#shippingquery).
|
/// [The official docs](https://core.telegram.org/bots/api#shippingquery).
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct ShippingQuery {
|
pub struct ShippingQuery {
|
||||||
/// Unique query identifier.
|
/// Unique query identifier.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -6,7 +6,7 @@ use crate::types::{MaskPosition, PhotoSize};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#sticker).
|
/// [The official docs](https://core.telegram.org/bots/api#sticker).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Sticker {
|
pub struct Sticker {
|
||||||
/// Identifier for this file.
|
/// Identifier for this file.
|
||||||
pub file_id: String,
|
pub file_id: String,
|
||||||
|
|
|
@ -5,7 +5,7 @@ use crate::types::Sticker;
|
||||||
/// This object represents a sticker set.
|
/// This object represents a sticker set.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#stickerset).
|
/// [The official docs](https://core.telegram.org/bots/api#stickerset).
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct StickerSet {
|
pub struct StickerSet {
|
||||||
/// Sticker set name.
|
/// Sticker set name.
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
|
|
@ -6,7 +6,7 @@ use crate::types::OrderInfo;
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#successfulpayment).
|
/// [The official docs](https://core.telegram.org/bots/api#successfulpayment).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct SuccessfulPayment {
|
pub struct SuccessfulPayment {
|
||||||
/// Three-letter ISO 4217 [currency] code.
|
/// Three-letter ISO 4217 [currency] code.
|
||||||
///
|
///
|
||||||
|
|
|
@ -9,7 +9,7 @@ use crate::types::{CallbackQuery, ChosenInlineResult, InlineQuery, Message};
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#update).
|
/// [The official docs](https://core.telegram.org/bots/api#update).
|
||||||
///
|
///
|
||||||
/// [object]: https://core.telegram.org/bots/api#available-types
|
/// [object]: https://core.telegram.org/bots/api#available-types
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Update {
|
pub struct Update {
|
||||||
/// The update‘s unique identifier. Update identifiers start from a certain
|
/// The update‘s 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
|
||||||
|
@ -27,7 +27,7 @@ pub struct Update {
|
||||||
pub kind: UpdateKind,
|
pub kind: UpdateKind,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
pub enum UpdateKind {
|
pub enum UpdateKind {
|
||||||
/// New incoming message of any kind — text, photo, sticker, etc.
|
/// New incoming message of any kind — text, photo, sticker, etc.
|
||||||
|
|
|
@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#user).
|
/// [The official docs](https://core.telegram.org/bots/api#user).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct User {
|
pub struct User {
|
||||||
/// Unique identifier for this user or bot.
|
/// Unique identifier for this user or bot.
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
|
|
@ -5,7 +5,7 @@ use crate::types::PhotoSize;
|
||||||
/// This object represent a user's profile pictures.
|
/// This object represent a user's profile pictures.
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#userprofilephotos).
|
/// [The official docs](https://core.telegram.org/bots/api#userprofilephotos).
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct UserProfilePhotos {
|
pub struct UserProfilePhotos {
|
||||||
/// Total number of profile pictures the target user has.
|
/// Total number of profile pictures the target user has.
|
||||||
pub total_count: u32,
|
pub total_count: u32,
|
||||||
|
|
|
@ -4,7 +4,7 @@ use crate::types::Location;
|
||||||
|
|
||||||
/// This object represents a venue.
|
/// This object represents a venue.
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Venue {
|
pub struct Venue {
|
||||||
/// Venue location.
|
/// Venue location.
|
||||||
pub location: Location,
|
pub location: Location,
|
||||||
|
|
|
@ -6,7 +6,7 @@ use crate::types::PhotoSize;
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#video).
|
/// [The official docs](https://core.telegram.org/bots/api#video).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Video {
|
pub struct Video {
|
||||||
/// Identifier for this file.
|
/// Identifier for this file.
|
||||||
pub file_id: String,
|
pub file_id: String,
|
||||||
|
|
|
@ -10,7 +10,7 @@ use crate::types::PhotoSize;
|
||||||
/// [video message]: https://telegram.org/blog/video-messages-and-telescope
|
/// [video message]: https://telegram.org/blog/video-messages-and-telescope
|
||||||
/// [v4.0]: https://telegram.org/blog/video-messages-and-telescope
|
/// [v4.0]: https://telegram.org/blog/video-messages-and-telescope
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct VideoNote {
|
pub struct VideoNote {
|
||||||
/// Identifier for this file.
|
/// Identifier for this file.
|
||||||
pub file_id: String,
|
pub file_id: String,
|
||||||
|
|
|
@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#voice).
|
/// [The official docs](https://core.telegram.org/bots/api#voice).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Voice {
|
pub struct Voice {
|
||||||
/// Identifier for this file.
|
/// Identifier for this file.
|
||||||
pub file_id: String,
|
pub file_id: String,
|
||||||
|
|
|
@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
|
||||||
///
|
///
|
||||||
/// [The official docs](https://core.telegram.org/bots/api#webhookinfo).
|
/// [The official docs](https://core.telegram.org/bots/api#webhookinfo).
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct WebhookInfo {
|
pub struct WebhookInfo {
|
||||||
/// Webhook URL, may be empty if webhook is not set up.
|
/// Webhook URL, may be empty if webhook is not set up.
|
||||||
pub url: String,
|
pub url: String,
|
||||||
|
|
Loading…
Reference in a new issue