mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Little bit of refactoring
This commit is contained in:
parent
383d17ef47
commit
7482534335
2 changed files with 8 additions and 6 deletions
|
@ -4,7 +4,7 @@ use crate::core::types::{
|
|||
SuccessfulPayment, User, Venue, Video, VideoNote, Voice,
|
||||
};
|
||||
|
||||
#[derive(Debug, Deserialize, Eq, Hash, PartialEq, Clone, Serialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
||||
pub struct Message {
|
||||
#[serde(rename = "message_id")]
|
||||
pub id: i64,
|
||||
|
@ -14,7 +14,7 @@ pub struct Message {
|
|||
pub message_kind: MessageKind,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Eq, Hash, PartialEq, Clone, Serialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum MessageKind {
|
||||
IncomingMessage {
|
||||
|
@ -72,7 +72,7 @@ pub enum MessageKind {
|
|||
},
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Eq, Hash, PartialEq, Clone, Serialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
||||
pub enum Sender {
|
||||
/// If message is sent from Chat
|
||||
#[serde(rename = "from")]
|
||||
|
@ -82,7 +82,7 @@ pub enum Sender {
|
|||
Signature(String),
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Eq, Hash, PartialEq, Clone, Serialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum ForwardKind {
|
||||
ChannelForward {
|
||||
|
@ -106,7 +106,7 @@ pub enum ForwardKind {
|
|||
},
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Eq, Hash, PartialEq, Clone, Serialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
||||
pub enum ForwardedFrom {
|
||||
#[serde(rename = "forward_from")]
|
||||
User(User),
|
||||
|
@ -114,7 +114,7 @@ pub enum ForwardedFrom {
|
|||
SenderName(String),
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Eq, Hash, PartialEq, Clone, Serialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum MediaKind {
|
||||
Animation {
|
||||
|
|
|
@ -19,6 +19,7 @@ pub use self::{
|
|||
order_info::OrderInfo,
|
||||
parse_mode::ParseMode,
|
||||
photo_size::PhotoSize,
|
||||
poll::{Poll, PollOption},
|
||||
pre_checkout_query::PreCheckoutQuery,
|
||||
response_parameters::ResponseParameters,
|
||||
send_invoice::SendInvoice,
|
||||
|
@ -60,6 +61,7 @@ mod not_implemented_types;
|
|||
mod order_info;
|
||||
mod parse_mode;
|
||||
mod photo_size;
|
||||
mod poll;
|
||||
mod pre_checkout_query;
|
||||
mod response_parameters;
|
||||
mod reply_markup;
|
||||
|
|
Loading…
Reference in a new issue