Skip to main content
Deno 2 is finally here πŸŽ‰οΈ
Learn more
Module

x/grammy/mod.ts>Api#sendDice

The Telegram Bot Framework.
Very Popular
Go to Latest
method Api.prototype.sendDice
import { Api } from "https://deno.land/x/grammy@v1.31.2/mod.ts";

Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.

Parameters

chat_id: number | string

Unique identifier for the target chat or username of the target channel (in the format @channelusername)

emoji:
| (string & Record<never, never>)
| "🎲"
| "🎯"
| "πŸ€"
| "⚽"
| "🎳"
| "🎰"

Emoji on which the dice throw animation is based. Currently, must be one of β€œπŸŽ²β€, β€œπŸŽ―β€, β€œπŸ€β€, β€œβš½β€, β€œπŸŽ³β€, or β€œπŸŽ°β€. Dice can have values 1-6 for β€œπŸŽ²β€, β€œπŸŽ―β€ and β€œπŸŽ³β€, values 1-5 for β€œπŸ€β€ and β€œβš½β€, and values 1-64 for β€œπŸŽ°β€. Defaults to β€œπŸŽ²β€

optional
other: Other<R, "sendDice", "chat_id" | "emoji">

Optional remaining parameters, confer the official reference below

optional
signal: AbortSignal

Optional AbortSignal to cancel the request

Official reference: https://core.telegram.org/bots/api#senddice