mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-31 16:40:37 +01:00
SendDiceEmoji -> DiceEmoji
This commit is contained in:
parent
30ee253376
commit
5afbef5734
2 changed files with 12 additions and 12 deletions
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue