telegram.Dice

class telegram.Dice(value, emoji, **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”.)

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.

value

Value of the dice.

Type:int
emoji

Emoji on which the dice throw animation is based.

Type:str
Parameters:
  • value (int) – Value of the dice. 1-6 for dice and darts, 1-5 for basketball.
  • emoji (str) – Emoji on which the dice throw animation is based.
ALL_EMOJI = ['🎲', '🎯', '🏀']

List of all supported base emoji. Currently DICE, DARTS and BASKETBALL.

Type:List[str]
BASKETBALL = '🏀'

‘🏀’

Type:str
DARTS = '🎯'

‘🎯’

Type:str
DICE = '🎲'

‘🎲’

Type:str