add inputMedia

This commit is contained in:
fedechkin_alexey 2019-09-03 15:57:28 +07:00
parent a311458454
commit 40c362de05

View 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,
}