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,
#[serde(flatten)]
emoji: Option<SendDiceEmoji>,
emoji: Option<DiceEmoji>,
disable_notification: Option<bool>,
reply_to_message_id: Option<i32>,
reply_markup: Option<ReplyMarkup>,
@ -57,7 +57,7 @@ impl SendDice {
}
/// 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
}
@ -92,7 +92,7 @@ impl SendDice {
}
#[derive(Copy, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
pub enum SendDiceEmoji {
pub enum DiceEmoji {
/// Values from 1-6. Defaults to this variant.
#[serde(rename = "🎲")]
Dice,

View file

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