telegram.Dice

class telegram.Dice(value: int, emoji: str, **_kwargs)

Bases: telegram.base.TelegramObject

This 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 value and emoji are equal.

Note

If emoji is “🎯”, 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 emoji is “🏀”, 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 emoji is “⚽”, 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 emoji is “🎰”, each value corresponds to a unique combination of symbols, which can be found at our wiki. However, this behaviour is undocumented and might be changed by Telegram.

Parameters:
  • value (int) – Value of the dice. 1-6 for dice and darts, 1-5 for basketball and football/soccer ball, 1-64 for slot machine.
  • emoji (str) – Emoji on which the dice throw animation is based.
value

Value of the dice.

Type:int
emoji

Emoji on which the dice throw animation is based.

Type:str
ALL_EMOJI = ['🎲', '🎯', '🏀', '⚽', '🎰']

telegram.constants.DICE_ALL_EMOJI

BASKETBALL = '🏀'

telegram.constants.DICE_BASKETBALL

DARTS = '🎯'

telegram.constants.DICE_DARTS

DICE = '🎲'

telegram.constants.DICE_DICE

FOOTBALL = '⚽'

telegram.constants.DICE_FOOTBALL

SLOT_MACHINE = '🎰'

telegram.constants.DICE_SLOT_MACHINE