mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
add inputMedia
This commit is contained in:
parent
a311458454
commit
40c362de05
1 changed files with 68 additions and 0 deletions
|
@ -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,
|
||||
}
|
Loading…
Reference in a new issue