Dice¶
- class telegram.Dice(value, emoji, *, api_kwargs=None)[source]¶
Bases:
telegram.TelegramObjectThis object represents an animated emoji with a random value for currently supported base emoji. (The singular form of “dice” is “die”. However, PTB mimics the Telegram API, which uses the term “dice”.)
Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their
valueandemojiare equal.Note
If
emojiis'🎯', a value of 6 currently represents a bullseye, while a value of 1 indicates that the dartboard was missed. However, this behaviour is undocumented and might be changed by Telegram.If
emojiis'🏀', a value of 4 or 5 currently score a basket, while a value of 1 to 3 indicates that the basket was missed. However, this behaviour is undocumented and might be changed by Telegram.If
emojiis'⚽', a value of 4 to 5 currently scores a goal, while a value of 1 to 3 indicates that the goal was missed. However, this behaviour is undocumented and might be changed by Telegram.If
emojiis'🎳', a value of 6 knocks all the pins, while a value of 1 means all the pins were missed. However, this behaviour is undocumented and might be changed by Telegram.If
emojiis'🎰', each value corresponds to a unique combination of symbols, which can be found in our wiki. However, this behaviour is undocumented and might be changed by Telegram.Available In
- Parameters:
- value[source]¶
Value of the dice.
1-6for'🎲','🎯'and'🎳'base emoji,1-5for'🏀'and'⚽'base emoji,1-64for'🎰'base emoji.- Type:
int
- ALL_EMOJI = [<DiceEmoji.DICE>, <DiceEmoji.DARTS>, <DiceEmoji.BASKETBALL>, <DiceEmoji.FOOTBALL>, <DiceEmoji.SLOT_MACHINE>, <DiceEmoji.BOWLING>][source]¶
A list of all available dice emoji.
- Type:
list[
str]
- BOWLING = '🎳'[source]¶
telegram.constants.DiceEmoji.BOWLINGAdded in version 13.4.
- MAX_VALUE_BASKETBALL = 5[source]¶
telegram.constants.DiceLimit.MAX_VALUE_BASKETBALLAdded in version 20.0.
- MAX_VALUE_BOWLING = 6[source]¶
telegram.constants.DiceLimit.MAX_VALUE_BOWLINGAdded in version 20.0.
- MAX_VALUE_DARTS = 6[source]¶
telegram.constants.DiceLimit.MAX_VALUE_DARTSAdded in version 20.0.
- MAX_VALUE_DICE = 6[source]¶
telegram.constants.DiceLimit.MAX_VALUE_DICEAdded in version 20.0.
- MAX_VALUE_FOOTBALL = 5[source]¶
telegram.constants.DiceLimit.MAX_VALUE_FOOTBALLAdded in version 20.0.
- MAX_VALUE_SLOT_MACHINE = 64[source]¶
telegram.constants.DiceLimit.MAX_VALUE_SLOT_MACHINEAdded in version 20.0.
- MIN_VALUE = 1[source]¶
telegram.constants.DiceLimit.MIN_VALUEAdded in version 20.0.