mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Merge branch 'dev' of https://github.com/async-telegram-bot/async-telegram-bot into dev
This commit is contained in:
commit
6de592fa6b
3 changed files with 70 additions and 0 deletions
4
src/core/parse_mode.rs
Normal file
4
src/core/parse_mode.rs
Normal file
|
@ -0,0 +1,4 @@
|
|||
pub enum ParseMode {
|
||||
HTML,
|
||||
Markdown,
|
||||
}
|
11
src/core/types/chosen_inline_result.rs
Normal file
11
src/core/types/chosen_inline_result.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
use serde::Deserialize;
|
||||
use crate::core::types::user::User;
|
||||
|
||||
#[derive(Debug, Deserealize)]
|
||||
pub struct ChosenInlineResult {
|
||||
pub result_id: String,
|
||||
pub from: User,
|
||||
pub location: Option<Location>,
|
||||
pub inline_message_id: Option<String>,
|
||||
pub query: String,
|
||||
}
|
55
src/core/types/input_message_content.rs
Normal file
55
src/core/types/input_message_content.rs
Normal file
|
@ -0,0 +1,55 @@
|
|||
use serde::Serialize;
|
||||
use crate::core::parse_mode::ParseMode;
|
||||
|
||||
pub enum InputMessageContent {
|
||||
Text(InputTextMessageContent),
|
||||
Location(InputLocationMessageContent),
|
||||
Venue(InputVenueMessageContent),
|
||||
Contact(InputContactMessageContent),
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub struct InputTextMessageContent {
|
||||
pub message_text: String,
|
||||
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub parse_mode: Option<ParseMode>,
|
||||
|
||||
#[serde(skip_serializing_if = "Not::not")]
|
||||
pub disable_web_page_preview: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub struct InputLocationMessageContent {
|
||||
pub latitude: f64,
|
||||
pub longitude: f64,
|
||||
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub live_period: Option<u32> // should be between 60 and 86400
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub struct InputVenueMessageContent {
|
||||
pub latitude: f64,
|
||||
pub longitude: f64,
|
||||
pub title: String,
|
||||
pub address: String,
|
||||
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub foursquare_id: Option<String>,
|
||||
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub foursquare_type: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub struct InputContactMessageContent {
|
||||
pub phone_number: String,
|
||||
pub first_name: String,
|
||||
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub last_name: Option<String>,
|
||||
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub vcard: Option<String>,
|
||||
}
|
Loading…
Reference in a new issue