SendDiceEmoji -> DiceEmoji

This commit is contained in:
Temirkhan Myrzamadi 2020-07-29 03:38:11 +06:00
parent 30ee253376
commit 5afbef5734
2 changed files with 12 additions and 12 deletions

View file

@ -16,7 +16,7 @@ pub struct SendDice {
chat_id: ChatId, chat_id: ChatId,
#[serde(flatten)] #[serde(flatten)]
emoji: Option<SendDiceEmoji>, emoji: Option<DiceEmoji>,
disable_notification: Option<bool>, disable_notification: Option<bool>,
reply_to_message_id: Option<i32>, reply_to_message_id: Option<i32>,
reply_markup: Option<ReplyMarkup>, reply_markup: Option<ReplyMarkup>,
@ -57,7 +57,7 @@ impl SendDice {
} }
/// Emoji on which the dice throw animation is based. /// Emoji on which the dice throw animation is based.
pub fn emoji(mut self, val: SendDiceEmoji) -> Self { pub fn emoji(mut self, val: DiceEmoji) -> Self {
self.emoji = Some(val); self.emoji = Some(val);
self self
} }
@ -92,7 +92,7 @@ impl SendDice {
} }
#[derive(Copy, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)] #[derive(Copy, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
pub enum SendDiceEmoji { pub enum DiceEmoji {
/// Values from 1-6. Defaults to this variant. /// Values from 1-6. Defaults to this variant.
#[serde(rename = "🎲")] #[serde(rename = "🎲")]
Dice, Dice,

View file

@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::requests::SendDiceEmoji; use crate::requests::DiceEmoji;
/// This object represents an animated emoji that displays a random value. /// This object represents an animated emoji that displays a random value.
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
@ -8,25 +8,25 @@ use crate::requests::SendDiceEmoji;
#[non_exhaustive] #[non_exhaustive]
pub struct Dice { pub struct Dice {
/// Emoji on which the dice throw animation is based. /// Emoji on which the dice throw animation is based.
emoji: SendDiceEmoji, emoji: DiceEmoji,
/// Value of the dice. /// Value of the dice.
/// ///
/// 1-6 for [`SendDiceEmoji::Dice`] and [`SendDiceEmoji::Darts`], 1-5 for /// 1-6 for [`DiceEmoji::Dice`] and [`DiceEmoji::Darts`], 1-5 for
/// [`SendDiceEmoji::Basketball`]. /// [`DiceEmoji::Basketball`].
/// ///
/// [`SendDiceEmoji::Dice`]: crate::types::SendDiceEmoji::Dice /// [`DiceEmoji::Dice`]: crate::types::DiceEmoji::Dice
/// [`SendDiceEmoji::Darts`]:crate::types::SendDiceEmoji::Darts /// [`DiceEmoji::Darts`]:crate::types::DiceEmoji::Darts
/// [`SendDiceEmoji::Basketball`]:crate::types::SendDiceEmoji::Basketball /// [`DiceEmoji::Basketball`]:crate::types::DiceEmoji::Basketball
value: i32, value: i32,
} }
impl Dice { impl Dice {
pub fn new(emoji: SendDiceEmoji, value: i32) -> Self { pub fn new(emoji: DiceEmoji, value: i32) -> Self {
Self { emoji, value } Self { emoji, value }
} }
pub fn emoji(mut self, val: SendDiceEmoji) -> Self { pub fn emoji(mut self, val: DiceEmoji) -> Self {
self.emoji = val; self.emoji = val;
self self
} }