Merge branch 'dev' of github.com:async-telegram-bot/async-telegram-bot into dev

This commit is contained in:
Waffle 2019-09-03 12:03:51 +03:00
commit 6e2f5c2da6
12 changed files with 92 additions and 0 deletions

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

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

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

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