Readonly
objReadonly
typeStatic
Readonly
TYPE_A basketball thrown into a hoop.
value represents the motion of the ball:
Static
Readonly
TYPE_A bowling ball thrown to pins.
Assuming the following identifiers for the pins:
4 5 6
2 3
1
value represents the motion of the ball and pins:
Static
Readonly
TYPE_A dart. Telegram dart has 4 rings and middle.
value represents the position of the dart:
Static
Readonly
TYPE_A simple 6-sided dice.
value represents its value (1-6)
Static
Readonly
TYPE_A football thrown to the gate.
value represents the motion of the ball:
Static
Readonly
TYPE_A slot machine.
value represents the result of the machine.
Value itself is an integer in range [1, 64]
,
and is composed out of several parts.
Note: The following information is based on the TDesktop implementation. These are the relevant files:
Unlike other animated dices, this does not have
all the possible combinations in the sticker set.
Instead, value
is a specially encoded integer that contains
the information about the indexes.
There are some base parts of the animations:
777
)The machine result is encoded as 3 concatenated two-bit integers, and the resulting integer is incremented by one.
So, to decode the value to its parts, you can use this code:
const computePartValue = (val: number, idx: number) => ((val - 1) >> (idx * 2)) & 0x03; // 0..3
const parts = [
computePartValue(msg.media.value, 0),
computePartValue(msg.media.value, 1),
computePartValue(msg.media.value, 2),
]
Each part of the value corresponds to a particular slot (i.e. part 0 is left slot, part 1 is middle, part 2 is right). The slot values are as follows:
Therefore, the winning value (i.e. 777
) is represented as (3 << 4 | 3 << 2 | 3 << 0) + 1 = 64
To determine the needed animation parts, you'll need to apply some shifts. These are the offsets for the individual symbols:
And these are the shifts for each slot:
WIN_SEVEN is the same as SEVEN, but only used if the machine result is
777
(i.e.value = 64
), as it contains additional "blinking" animation.
The sticker index is computed as follows: SHIFTS[SLOT] + OFFSETS[SYM]
.
For example, berries for the middle slot would be: SHIFTS[MIDDLE] + OFFSETS[BERRIES] = 9 + 3 = 12
Currently, this sticker set is used for the machine: SlotMachineAnimated
An emoji which was originally sent.
See static members of Dice for a list of possible values
Input media TL object generated from this object, to be used inside InputMediaLike and TelegramClient.sendMedia
Note that when you use this media, a new value
will be generated!
Emoji's interactive value.
See what this value represents in the corresponding type's documentation (in Dice static fields)
A dice or another interactive random emoji.