mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Merge branch 'dev' of github.com:async-telegram-bot/async-telegram-bot into dev
This commit is contained in:
commit
6e2f5c2da6
12 changed files with 92 additions and 0 deletions
8
src/core/types/input_file.rs
Normal file
8
src/core/types/input_file.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub enum InputFile {
|
||||
File(std::fs::File),
|
||||
Url(String),
|
||||
FileId(String),
|
||||
}
|
68
src/core/types/input_media.rs
Normal file
68
src/core/types/input_media.rs
Normal file
|
@ -0,0 +1,68 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
pub enum InputMedia {
|
||||
InputMediaPhoto(InputMediaPhoto),
|
||||
InputMediaVideo(InputMediaVideo),
|
||||
InputMediaAnimation(InputMediaAnimation),
|
||||
InputMediaAudio(InputMediaAudiotype),
|
||||
InputMediaDocument(InputMediaDocument),
|
||||
}
|
||||
|
||||
pub enum ThumbKind {
|
||||
InputFile,
|
||||
String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub struct InputMediaPhoto {
|
||||
type_: String,
|
||||
media: String,
|
||||
caption: Option<String>,
|
||||
parse_mode: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub struct InputMediaVideo {
|
||||
type_: String,
|
||||
media: String,
|
||||
thumb: ThumbKind,
|
||||
caption: Option<String>,
|
||||
parse_mode: Option<String>,
|
||||
width: Option<i64>,
|
||||
height: Option<i64>,
|
||||
duration: Option<i64>,
|
||||
supports_streaming: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub struct InputMediaAnimation {
|
||||
type_: String,
|
||||
media: String,
|
||||
thumb: Option<ThumbKind>,
|
||||
caption: Option<String>,
|
||||
parse_mode: Option<String>,
|
||||
width: Option<i64>,
|
||||
height: Option<i64>,
|
||||
duration: Option<i64>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub struct InputMediaAudio {
|
||||
type_: String,
|
||||
media: String,
|
||||
thumb: Option<ThumbKind>,
|
||||
caption: Option<String>,
|
||||
parse_mode: Option<String>,
|
||||
duration: Option<i64>,
|
||||
performer: Option<i64>,
|
||||
title: Option<String>
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub struct InputMediaDocument {
|
||||
type_: String,
|
||||
media: String,
|
||||
thumb: Option<ThumbKind>,
|
||||
caption: Option<String>,
|
||||
parse_mode: parse_mode,
|
||||
}
|
9
src/core/types/login_url.rs
Normal file
9
src/core/types/login_url.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct LoginUrl {
|
||||
url: String,
|
||||
forward_text: Option<String>,
|
||||
bot_username: Option<String>,
|
||||
request_write_access: Option<bool>,
|
||||
}
|
7
src/core/types/response_paramter.rs
Normal file
7
src/core/types/response_paramter.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct ResponseParameters {
|
||||
migrate_to_chat_id: Option<i64>,
|
||||
retry_after: Option<i64>,
|
||||
}
|
Loading…
Reference in a new issue