How to send animated game emojis to the bot with a random game result
Game emojis are supported only in Telegram. You can send them to the bot using the sendDice Telegram API method.
There are several ways to send game emojis:
How to send an animated emoji with Native request:
1. Add Native Request to the screen.
2. Select the Telegram platform.
3. Select the sendDice request method.
4. Add Request Body.
Required parameters for Request body:
- chat_id is a unique user identification in the bot. We get it as the key variable {{this_user.platform_id}}. If you leave it unchanged, the images will be sent to the user who got to the Native request component in the bot.
- emoji is the emoji you want to send.
The request body will be like this:
{ "chat_id": "{{this_user.platform_id}}", "emoji": "⚽" }
Instead of a soccer ball, you can add any other animated emoji. For example, you can copy one of these:
🎯
🎲
🎳
🏀
🎰
Add Request body to the component settings:
After saving, when the component is activated, the bot will send an animated emoji from the request. With each new activation of the component, the emoji will come with a different result.
How to send an animated emoji with a request via button
1. Add the Button component to the screen.
2. Add text before the button and on the button.
3. Click on the button in the builder to see the settings and click the Ability to send request.
4. Add Request URL according to the template
https://api.telegram.org/bot12345/sendDice
Instead of 12345, add your bot token. You can find out the token by sending the /token command to BotFather.
5. Select the request method: POST. Do not change the request headers and leave the JSON parser unchanged.
6. Add Request Body:
{
"chat_id": "{{this_user.platform_id}}",
"emoji": "⚽"
}
Instead of the emoji from the example, you can always choose any other animated emoji:
🎯
🎲
🎳
🏀
🎰
8. You may not edit the rest of the settings, but if necessary, you can change them.
More information about the POST request and its settings can be found here →
If necessary, animated emojis can also be sent by the same request through the API Requests component →
After saving, when activating the component, the bot will send buttons. After clicking these buttons, users will receive an animated emoji. Every time they click on the button, the emoji will come with a different result.