From 1b7252382f053ce51dde8a211f8f59b561368a73 Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Mon, 5 Jun 2023 16:04:45 +0400 Subject: [PATCH] Fixup `Dice` and `DiceEmoji` --- crates/teloxide-core/CHANGELOG.md | 2 ++ crates/teloxide-core/src/types/dice.rs | 10 +++----- crates/teloxide-core/src/types/dice_emoji.rs | 24 ++++++++++---------- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/crates/teloxide-core/CHANGELOG.md b/crates/teloxide-core/CHANGELOG.md index 40d9a04a..772b4978 100644 --- a/crates/teloxide-core/CHANGELOG.md +++ b/crates/teloxide-core/CHANGELOG.md @@ -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]) - `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]) +- `DiceEmoji` variant order ([#887][pr887]) +- `Dice::value` now use `u8`, instead of `i32` ([#887][pr887]) [pr852]: https://github.com/teloxide/teloxide/pull/853 [pr859]: https://github.com/teloxide/teloxide/pull/859 diff --git a/crates/teloxide-core/src/types/dice.rs b/crates/teloxide-core/src/types/dice.rs index 67f69bbb..72757c65 100644 --- a/crates/teloxide-core/src/types/dice.rs +++ b/crates/teloxide-core/src/types/dice.rs @@ -11,11 +11,7 @@ pub struct Dice { /// Value of the dice. /// - /// 1-6 for [`DiceEmoji::Dice`] and [`DiceEmoji::Darts`], 1-5 for - /// [`DiceEmoji::Basketball`]. - /// - /// [`DiceEmoji::Dice`]: crate::types::DiceEmoji::Dice - /// [`DiceEmoji::Darts`]:crate::types::DiceEmoji::Darts - /// [`DiceEmoji::Basketball`]:crate::types::DiceEmoji::Basketball - pub value: i32, + /// Value of the dice, 1-6 for 🎲, 🎯 and 🎳 base emoji, 1-5 for 🏀 and ⚽ + /// base emoji, 1-64 for 🎰 base emoji + pub value: u8, } diff --git a/crates/teloxide-core/src/types/dice_emoji.rs b/crates/teloxide-core/src/types/dice_emoji.rs index c5e1a69b..0d73e667 100644 --- a/crates/teloxide-core/src/types/dice_emoji.rs +++ b/crates/teloxide-core/src/types/dice_emoji.rs @@ -2,27 +2,27 @@ use serde::{Deserialize, Serialize}; #[derive(Copy, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)] pub enum DiceEmoji { - /// Values from 1-6. Defaults to this variant. + /// "🎲" emoji. Values from 1-6. Defaults to this variant. #[serde(rename = "🎲")] Dice, - /// Values from 1-6. + /// "🎯" emoji. Values from 1-6. #[serde(rename = "🎯")] Darts, - /// Values from 1-5. - #[serde(rename = "🏀")] - Basketball, - - /// Values 1-5 - #[serde(rename = "⚽")] - Football, - - /// Values 1-5 + /// "🎳" emoji. Values 1-6 #[serde(rename = "🎳")] 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 = "🎰")] SlotMachine, }