Fixup Dice and DiceEmoji

This commit is contained in:
Maybe Waffle 2023-06-05 16:04:45 +04:00
parent 4a041ac4e0
commit 1b7252382f
3 changed files with 17 additions and 19 deletions

View file

@ -52,6 +52,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Renamed `ForumTopic::message_thread_id` into `thread_id` ([#887][pr887]) - Renamed `ForumTopic::message_thread_id` into `thread_id` ([#887][pr887])
- `ForumTopic::thread_id` and `Message::thread_id` now use `ThreadId` instead of `i32` ([#887][pr887]) - `ForumTopic::thread_id` and `Message::thread_id` now use `ThreadId` instead of `i32` ([#887][pr887])
- `message_thread_id` method parameters now use `ThreadId` instead of `i32` ([#887][pr887]) - `message_thread_id` method parameters now use `ThreadId` instead of `i32` ([#887][pr887])
- `DiceEmoji` variant order ([#887][pr887])
- `Dice::value` now use `u8`, instead of `i32` ([#887][pr887])
[pr852]: https://github.com/teloxide/teloxide/pull/853 [pr852]: https://github.com/teloxide/teloxide/pull/853
[pr859]: https://github.com/teloxide/teloxide/pull/859 [pr859]: https://github.com/teloxide/teloxide/pull/859

View file

@ -11,11 +11,7 @@ pub struct Dice {
/// Value of the dice. /// Value of the dice.
/// ///
/// 1-6 for [`DiceEmoji::Dice`] and [`DiceEmoji::Darts`], 1-5 for /// Value of the dice, 1-6 for 🎲, 🎯 and 🎳 base emoji, 1-5 for 🏀 and ⚽
/// [`DiceEmoji::Basketball`]. /// base emoji, 1-64 for 🎰 base emoji
/// pub value: u8,
/// [`DiceEmoji::Dice`]: crate::types::DiceEmoji::Dice
/// [`DiceEmoji::Darts`]:crate::types::DiceEmoji::Darts
/// [`DiceEmoji::Basketball`]:crate::types::DiceEmoji::Basketball
pub value: i32,
} }

View file

@ -2,27 +2,27 @@ use serde::{Deserialize, Serialize};
#[derive(Copy, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)] #[derive(Copy, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
pub enum DiceEmoji { pub enum DiceEmoji {
/// Values from 1-6. Defaults to this variant. /// "🎲" emoji. Values from 1-6. Defaults to this variant.
#[serde(rename = "🎲")] #[serde(rename = "🎲")]
Dice, Dice,
/// Values from 1-6. /// "🎯" emoji. Values from 1-6.
#[serde(rename = "🎯")] #[serde(rename = "🎯")]
Darts, Darts,
/// Values from 1-5. /// "🎳" emoji. Values 1-6
#[serde(rename = "🏀")]
Basketball,
/// Values 1-5
#[serde(rename = "")]
Football,
/// Values 1-5
#[serde(rename = "🎳")] #[serde(rename = "🎳")]
Bowling, Bowling,
/// Values 1-64 /// "🏀" emoji. Values from 1-5.
#[serde(rename = "🏀")]
Basketball,
/// "⚽" emoji. Values 1-5
#[serde(rename = "")]
Football,
/// "🎰" emoji. Values 1-64
#[serde(rename = "🎰")] #[serde(rename = "🎰")]
SlotMachine, SlotMachine,
} }