mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-25 08:02:06 +01:00
Merge pull request #86 from telebofr/move-ci-to-actions
Move CI to github actions
This commit is contained in:
commit
c32e0fbdfc
15 changed files with 127 additions and 62 deletions
71
.github/workflows/ci.yml
vendored
Normal file
71
.github/workflows/ci.yml
vendored
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
name: Continuous integration
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
rust:
|
||||||
|
- stable
|
||||||
|
- beta
|
||||||
|
- nightly
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: ${{ matrix.rust }}
|
||||||
|
override: true
|
||||||
|
components: rustfmt, clippy
|
||||||
|
|
||||||
|
- name: stable/beta build
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
if: matrix.rust == 'stable' || matrix.rust == 'beta'
|
||||||
|
with:
|
||||||
|
command: build
|
||||||
|
args: --verbose --features ""
|
||||||
|
|
||||||
|
- name: nightly build
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
if: matrix.rust == 'nightly'
|
||||||
|
with:
|
||||||
|
command: build
|
||||||
|
args: --verbose --all-features
|
||||||
|
|
||||||
|
- name: stable/beta test
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
if: matrix.rust == 'stable' || matrix.rust == 'beta'
|
||||||
|
with:
|
||||||
|
command: test
|
||||||
|
args: --verbose --features ""
|
||||||
|
|
||||||
|
- name: nightly test
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
if: matrix.rust == 'nightly'
|
||||||
|
with:
|
||||||
|
command: test
|
||||||
|
args: --verbose --all-features
|
||||||
|
|
||||||
|
- name: fmt
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: fmt
|
||||||
|
args: --all -- --check
|
||||||
|
|
||||||
|
- name: stable/beta clippy
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
if: matrix.rust == 'stable' || matrix.rust == 'beta'
|
||||||
|
with:
|
||||||
|
command: clippy
|
||||||
|
args: --all-targets --features "" -- -D warnings
|
||||||
|
|
||||||
|
- name: nightly clippy
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
if: matrix.rust == 'nightly'
|
||||||
|
with:
|
||||||
|
command: clippy
|
||||||
|
args: --all-targets --all-features -- -D warnings
|
10
.travis.yml
10
.travis.yml
|
@ -1,10 +0,0 @@
|
||||||
language: Rust
|
|
||||||
|
|
||||||
|
|
||||||
env:
|
|
||||||
- RUST_BACKTRACE=1
|
|
||||||
|
|
||||||
script:
|
|
||||||
- rustup override set nightly
|
|
||||||
- cargo build --all --verbose
|
|
||||||
- cargo test --all
|
|
|
@ -1,4 +1,6 @@
|
||||||
use std::{convert::Infallible, future::Future, pin::Pin};
|
#[cfg(not(feature = "never-type"))]
|
||||||
|
use std::convert::Infallible;
|
||||||
|
use std::{future::Future, pin::Pin};
|
||||||
|
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
|
|
||||||
|
@ -15,7 +17,7 @@ pub trait ErrorPolicy<E> {
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```
|
/// ```
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() {
|
/// # async fn main_() {
|
||||||
/// use telebofr::dispatching::dispatchers::filter::error_policy::{
|
/// use telebofr::dispatching::dispatchers::filter::error_policy::{
|
||||||
/// ErrorPolicy, Ignore,
|
/// ErrorPolicy, Ignore,
|
||||||
/// };
|
/// };
|
||||||
|
@ -45,7 +47,7 @@ where
|
||||||
/// ## Examples
|
/// ## Examples
|
||||||
/// ```
|
/// ```
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() {
|
/// # async fn main_() {
|
||||||
/// use std::convert::{TryInto, Infallible};
|
/// use std::convert::{TryInto, Infallible};
|
||||||
///
|
///
|
||||||
/// use telebofr::dispatching::dispatchers::filter::error_policy::{
|
/// use telebofr::dispatching::dispatchers::filter::error_policy::{
|
||||||
|
@ -82,23 +84,24 @@ where
|
||||||
pub struct IgnoreSafe;
|
pub struct IgnoreSafe;
|
||||||
|
|
||||||
#[cfg(feature = "never-type")]
|
#[cfg(feature = "never-type")]
|
||||||
|
#[allow(unreachable_code)]
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl ErrorPolicy<!> for IgnoreSafe {
|
impl ErrorPolicy<!> for IgnoreSafe {
|
||||||
async fn handle_error(&self, never: !)
|
async fn handle_error(&self, _: !)
|
||||||
where
|
where
|
||||||
!: 'async_trait,
|
!: 'async_trait,
|
||||||
{
|
{
|
||||||
never
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(feature = "never-type"))]
|
||||||
|
#[allow(unreachable_code)]
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl ErrorPolicy<Infallible> for IgnoreSafe {
|
impl ErrorPolicy<Infallible> for IgnoreSafe {
|
||||||
async fn handle_error(&self, inf: Infallible)
|
async fn handle_error(&self, _: Infallible)
|
||||||
where
|
where
|
||||||
Infallible: 'async_trait,
|
Infallible: 'async_trait,
|
||||||
{
|
{
|
||||||
match inf {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +110,7 @@ impl ErrorPolicy<Infallible> for IgnoreSafe {
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```
|
/// ```
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() {
|
/// # async fn main_() {
|
||||||
/// use telebofr::dispatching::dispatchers::filter::error_policy::ErrorPolicy;
|
/// use telebofr::dispatching::dispatchers::filter::error_policy::ErrorPolicy;
|
||||||
///
|
///
|
||||||
/// let closure = |e: i32| async move { eprintln!("Error code{}", e) };
|
/// let closure = |e: i32| async move { eprintln!("Error code{}", e) };
|
||||||
|
|
|
@ -7,7 +7,10 @@ use crate::{
|
||||||
dispatchers::filter::error_policy::ErrorPolicy, filters::Filter,
|
dispatchers::filter::error_policy::ErrorPolicy, filters::Filter,
|
||||||
handler::Handler, updater::Updater, Dispatcher,
|
handler::Handler, updater::Updater, Dispatcher,
|
||||||
},
|
},
|
||||||
types::{CallbackQuery, ChosenInlineResult, Message, Update, UpdateKind},
|
types::{
|
||||||
|
CallbackQuery, ChosenInlineResult, InlineQuery, Message, Update,
|
||||||
|
UpdateKind,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
pub mod error_policy;
|
pub mod error_policy;
|
||||||
|
@ -71,7 +74,7 @@ type FiltersAndHandlers<'a, T, E> = Vec<FilterAndHandler<'a, T, E>>;
|
||||||
///
|
///
|
||||||
/// // create dispatching which handlers can't fail
|
/// // create dispatching which handlers can't fail
|
||||||
/// // with error policy that just ignores all errors (that can't ever happen)
|
/// // with error policy that just ignores all errors (that can't ever happen)
|
||||||
/// let mut dp = FilterDispatcher::<Infallible, _>::new(|_| async { () })
|
/// let mut dp = FilterDispatcher::<Infallible, _>::new(|_| async {})
|
||||||
/// // Add 'handler' that will handle all messages sent to the bot
|
/// // Add 'handler' that will handle all messages sent to the bot
|
||||||
/// .message_handler(true, |mes: Message| {
|
/// .message_handler(true, |mes: Message| {
|
||||||
/// async move { println!("New message: {:?}", mes) }
|
/// async move { println!("New message: {:?}", mes) }
|
||||||
|
@ -94,7 +97,7 @@ pub struct FilterDispatcher<'a, E, Ep> {
|
||||||
edited_message_handlers: FiltersAndHandlers<'a, Message, E>,
|
edited_message_handlers: FiltersAndHandlers<'a, Message, E>,
|
||||||
channel_post_handlers: FiltersAndHandlers<'a, Message, E>,
|
channel_post_handlers: FiltersAndHandlers<'a, Message, E>,
|
||||||
edited_channel_post_handlers: FiltersAndHandlers<'a, Message, E>,
|
edited_channel_post_handlers: FiltersAndHandlers<'a, Message, E>,
|
||||||
inline_query_handlers: FiltersAndHandlers<'a, (), E>,
|
inline_query_handlers: FiltersAndHandlers<'a, InlineQuery, E>,
|
||||||
chosen_inline_result_handlers:
|
chosen_inline_result_handlers:
|
||||||
FiltersAndHandlers<'a, ChosenInlineResult, E>,
|
FiltersAndHandlers<'a, ChosenInlineResult, E>,
|
||||||
callback_query_handlers: FiltersAndHandlers<'a, CallbackQuery, E>,
|
callback_query_handlers: FiltersAndHandlers<'a, CallbackQuery, E>,
|
||||||
|
@ -165,8 +168,8 @@ where
|
||||||
|
|
||||||
pub fn inline_query_handler<F, H>(mut self, filter: F, handler: H) -> Self
|
pub fn inline_query_handler<F, H>(mut self, filter: F, handler: H) -> Self
|
||||||
where
|
where
|
||||||
F: Filter<()> + 'a,
|
F: Filter<InlineQuery> + 'a,
|
||||||
H: Handler<'a, (), E> + 'a,
|
H: Handler<'a, InlineQuery, E> + 'a,
|
||||||
{
|
{
|
||||||
self.inline_query_handlers
|
self.inline_query_handlers
|
||||||
.push(FilterAndHandler::new(filter, handler));
|
.push(FilterAndHandler::new(filter, handler));
|
||||||
|
@ -259,6 +262,7 @@ where
|
||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::ptr_arg)] // TODO: proper fix
|
||||||
async fn handle<T>(
|
async fn handle<T>(
|
||||||
&self,
|
&self,
|
||||||
update: T,
|
update: T,
|
||||||
|
@ -316,7 +320,7 @@ mod tests {
|
||||||
let counter = &AtomicI32::new(0);
|
let counter = &AtomicI32::new(0);
|
||||||
let counter2 = &AtomicI32::new(0);
|
let counter2 = &AtomicI32::new(0);
|
||||||
|
|
||||||
let mut dp = FilterDispatcher::<Infallible, _>::new(|_| async { () })
|
let mut dp = FilterDispatcher::<Infallible, _>::new(|_| async {})
|
||||||
.message_handler(true, |_mes: Message| {
|
.message_handler(true, |_mes: Message| {
|
||||||
async move {
|
async move {
|
||||||
counter.fetch_add(1, Ordering::SeqCst);
|
counter.fetch_add(1, Ordering::SeqCst);
|
||||||
|
@ -338,9 +342,9 @@ mod tests {
|
||||||
fn message() -> Message {
|
fn message() -> Message {
|
||||||
Message {
|
Message {
|
||||||
id: 6534,
|
id: 6534,
|
||||||
date: 1567898953,
|
date: 1_567_898_953,
|
||||||
chat: Chat {
|
chat: Chat {
|
||||||
id: 218485655,
|
id: 218_485_655,
|
||||||
photo: None,
|
photo: None,
|
||||||
kind: ChatKind::Private {
|
kind: ChatKind::Private {
|
||||||
type_: (),
|
type_: (),
|
||||||
|
@ -351,7 +355,7 @@ mod tests {
|
||||||
},
|
},
|
||||||
kind: MessageKind::Common {
|
kind: MessageKind::Common {
|
||||||
from: Sender::User(User {
|
from: Sender::User(User {
|
||||||
id: 457569668,
|
id: 457_569_668,
|
||||||
is_bot: true,
|
is_bot: true,
|
||||||
first_name: "BT".to_string(),
|
first_name: "BT".to_string(),
|
||||||
last_name: None,
|
last_name: None,
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![cfg_attr(feature = "never-type", feature(never_type))]
|
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate derive_more;
|
extern crate derive_more;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|
|
@ -37,7 +37,7 @@ mod tests {
|
||||||
performer: Some("Performer".to_string()),
|
performer: Some("Performer".to_string()),
|
||||||
title: Some("Title".to_string()),
|
title: Some("Title".to_string()),
|
||||||
mime_type: Some("MimeType".to_string()),
|
mime_type: Some("MimeType".to_string()),
|
||||||
file_size: Some(123456),
|
file_size: Some(123_456),
|
||||||
thumb: Some(PhotoSize {
|
thumb: Some(PhotoSize {
|
||||||
file_id: "id".to_string(),
|
file_id: "id".to_string(),
|
||||||
width: 320,
|
width: 320,
|
||||||
|
|
|
@ -18,7 +18,7 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn chat_id_id_serialization() {
|
fn chat_id_id_serialization() {
|
||||||
let expected_json = String::from(r#"123456"#);
|
let expected_json = String::from(r#"123456"#);
|
||||||
let actual_json = serde_json::to_string(&ChatId::Id(123456)).unwrap();
|
let actual_json = serde_json::to_string(&ChatId::Id(123_456)).unwrap();
|
||||||
|
|
||||||
assert_eq!(expected_json, actual_json)
|
assert_eq!(expected_json, actual_json)
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,7 @@ mod tests {
|
||||||
language_code: None,
|
language_code: None,
|
||||||
},
|
},
|
||||||
status: ChatMemberStatus::Creator,
|
status: ChatMemberStatus::Creator,
|
||||||
until_date: Some(123456),
|
until_date: Some(123_456),
|
||||||
can_be_edited: Some(true),
|
can_be_edited: Some(true),
|
||||||
can_change_info: Some(true),
|
can_change_info: Some(true),
|
||||||
can_post_messages: Some(true),
|
can_post_messages: Some(true),
|
||||||
|
|
|
@ -61,11 +61,14 @@ mod tests {
|
||||||
"text 2".to_string(),
|
"text 2".to_string(),
|
||||||
"url 2".to_string(),
|
"url 2".to_string(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let markup = InlineKeyboardMarkup::new()
|
let markup = InlineKeyboardMarkup::new()
|
||||||
.append_row(vec![button1.clone(), button2.clone()]);
|
.append_row(vec![button1.clone(), button2.clone()]);
|
||||||
|
|
||||||
let expected = InlineKeyboardMarkup {
|
let expected = InlineKeyboardMarkup {
|
||||||
inline_keyboard: vec![vec![button1.clone(), button2.clone()]],
|
inline_keyboard: vec![vec![button1, button2]],
|
||||||
};
|
};
|
||||||
|
|
||||||
assert_eq!(markup, expected);
|
assert_eq!(markup, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,12 +82,15 @@ mod tests {
|
||||||
"text 2".to_string(),
|
"text 2".to_string(),
|
||||||
"url 2".to_string(),
|
"url 2".to_string(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let markup = InlineKeyboardMarkup::new()
|
let markup = InlineKeyboardMarkup::new()
|
||||||
.append_row(vec![button1.clone()])
|
.append_row(vec![button1.clone()])
|
||||||
.append_to_row(button2.clone(), 0);
|
.append_to_row(button2.clone(), 0);
|
||||||
|
|
||||||
let expected = InlineKeyboardMarkup {
|
let expected = InlineKeyboardMarkup {
|
||||||
inline_keyboard: vec![vec![button1.clone(), button2.clone()]],
|
inline_keyboard: vec![vec![button1, button2]],
|
||||||
};
|
};
|
||||||
|
|
||||||
assert_eq!(markup, expected);
|
assert_eq!(markup, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,12 +104,15 @@ mod tests {
|
||||||
"text 2".to_string(),
|
"text 2".to_string(),
|
||||||
"url 2".to_string(),
|
"url 2".to_string(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let markup = InlineKeyboardMarkup::new()
|
let markup = InlineKeyboardMarkup::new()
|
||||||
.append_row(vec![button1.clone()])
|
.append_row(vec![button1.clone()])
|
||||||
.append_to_row(button2.clone(), 1);
|
.append_to_row(button2.clone(), 1);
|
||||||
|
|
||||||
let expected = InlineKeyboardMarkup {
|
let expected = InlineKeyboardMarkup {
|
||||||
inline_keyboard: vec![vec![button1.clone()], vec![button2.clone()]],
|
inline_keyboard: vec![vec![button1], vec![button2]],
|
||||||
};
|
};
|
||||||
|
|
||||||
assert_eq!(markup, expected);
|
assert_eq!(markup, expected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use crate::types::{Location, User};
|
use crate::types::{Location, User};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, PartialEq, Clone)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
|
||||||
pub struct InlineQuery {
|
pub struct InlineQuery {
|
||||||
/// Unique identifier for this query
|
/// Unique identifier for this query
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#![allow(clippy::large_enum_variant)]
|
||||||
|
|
||||||
use crate::types::{
|
use crate::types::{
|
||||||
InlineQueryResultArticle, InlineQueryResultAudio,
|
InlineQueryResultArticle, InlineQueryResultAudio,
|
||||||
InlineQueryResultCachedAudio, InlineQueryResultCachedDocument,
|
InlineQueryResultCachedAudio, InlineQueryResultCachedDocument,
|
||||||
|
@ -54,21 +56,6 @@ mod tests {
|
||||||
InlineQueryResult, InlineQueryResultCachedAudio, InputMessageContent,
|
InlineQueryResult, InlineQueryResultCachedAudio, InputMessageContent,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn into() {
|
|
||||||
let structure =
|
|
||||||
InlineQueryResult::CachedAudio(InlineQueryResultCachedAudio {
|
|
||||||
id: String::from("id"),
|
|
||||||
audio_file_id: String::from("audio_file_id"),
|
|
||||||
caption: None,
|
|
||||||
parse_mode: None,
|
|
||||||
reply_markup: None,
|
|
||||||
input_message_content: None,
|
|
||||||
});
|
|
||||||
|
|
||||||
let _: InlineQueryResult = structure.into();
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn cached_audio_min_serialize() {
|
fn cached_audio_min_serialize() {
|
||||||
let structure =
|
let structure =
|
||||||
|
|
|
@ -14,14 +14,14 @@ impl InputFile {
|
||||||
|
|
||||||
pub fn url<T>(url: T) -> Self
|
pub fn url<T>(url: T) -> Self
|
||||||
where
|
where
|
||||||
T: Into<String>
|
T: Into<String>,
|
||||||
{
|
{
|
||||||
Self::Url(url.into())
|
Self::Url(url.into())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn file_id<T>(file_id: T) -> Self
|
pub fn file_id<T>(file_id: T) -> Self
|
||||||
where
|
where
|
||||||
T: Into<String>
|
T: Into<String>,
|
||||||
{
|
{
|
||||||
Self::FileId(file_id.into())
|
Self::FileId(file_id.into())
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#![allow(clippy::large_enum_variant)]
|
||||||
|
|
||||||
use crate::types::{
|
use crate::types::{
|
||||||
Animation, Audio, Chat, Contact, Document, Game, InlineKeyboardMarkup,
|
Animation, Audio, Chat, Contact, Document, Game, InlineKeyboardMarkup,
|
||||||
Invoice, Location, MessageEntity, PassportData, PhotoSize, Poll, Sticker,
|
Invoice, Location, MessageEntity, PassportData, PhotoSize, Poll, Sticker,
|
||||||
|
|
|
@ -11,7 +11,7 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn migrate_to_chat_id_deserialization() {
|
fn migrate_to_chat_id_deserialization() {
|
||||||
let expected = ResponseParameters::MigrateToChatId(123456);
|
let expected = ResponseParameters::MigrateToChatId(123_456);
|
||||||
let actual: ResponseParameters =
|
let actual: ResponseParameters =
|
||||||
serde_json::from_str(r#"{"migrate_to_chat_id":123456}"#).unwrap();
|
serde_json::from_str(r#"{"migrate_to_chat_id":123456}"#).unwrap();
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn retry_after_deserialization() {
|
fn retry_after_deserialization() {
|
||||||
let expected = ResponseParameters::RetryAfter(123456);
|
let expected = ResponseParameters::RetryAfter(123_456);
|
||||||
let actual: ResponseParameters =
|
let actual: ResponseParameters =
|
||||||
serde_json::from_str(r#"{"retry_after":123456}"#).unwrap();
|
serde_json::from_str(r#"{"retry_after":123456}"#).unwrap();
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
use crate::types::{CallbackQuery, ChosenInlineResult, Message};
|
#![allow(clippy::large_enum_variant)]
|
||||||
|
|
||||||
|
use crate::types::{CallbackQuery, ChosenInlineResult, InlineQuery, Message};
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, PartialEq, Clone)]
|
#[derive(Debug, Deserialize, PartialEq, Clone)]
|
||||||
pub struct Update {
|
pub struct Update {
|
||||||
|
@ -15,8 +17,7 @@ pub enum UpdateKind {
|
||||||
EditedMessage(Message),
|
EditedMessage(Message),
|
||||||
ChannelPost(Message),
|
ChannelPost(Message),
|
||||||
EditedChannelPost(Message),
|
EditedChannelPost(Message),
|
||||||
InlineQuery(()),
|
InlineQuery(InlineQuery),
|
||||||
// TODO
|
|
||||||
ChosenInlineResult(ChosenInlineResult),
|
ChosenInlineResult(ChosenInlineResult),
|
||||||
CallbackQuery(CallbackQuery),
|
CallbackQuery(CallbackQuery),
|
||||||
}
|
}
|
||||||
|
@ -54,12 +55,12 @@ mod test {
|
||||||
}"#;
|
}"#;
|
||||||
|
|
||||||
let expected: Update = Update {
|
let expected: Update = Update {
|
||||||
id: 892252934,
|
id: 892_252_934,
|
||||||
kind: UpdateKind::Message(Message {
|
kind: UpdateKind::Message(Message {
|
||||||
id: 6557,
|
id: 6557,
|
||||||
date: 1569518342,
|
date: 1_569_518_342,
|
||||||
chat: Chat {
|
chat: Chat {
|
||||||
id: 218485655,
|
id: 218_485_655,
|
||||||
kind: ChatKind::Private {
|
kind: ChatKind::Private {
|
||||||
type_: (),
|
type_: (),
|
||||||
username: Some(String::from("WaffleLapkin")),
|
username: Some(String::from("WaffleLapkin")),
|
||||||
|
@ -70,7 +71,7 @@ mod test {
|
||||||
},
|
},
|
||||||
kind: MessageKind::Common {
|
kind: MessageKind::Common {
|
||||||
from: Sender::User(User {
|
from: Sender::User(User {
|
||||||
id: 218485655,
|
id: 218_485_655,
|
||||||
is_bot: false,
|
is_bot: false,
|
||||||
first_name: String::from("Waffle"),
|
first_name: String::from("Waffle"),
|
||||||
last_name: None,
|
last_name: None,
|
||||||
|
|
Loading…
Add table
Reference in a new issue