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

x/grammy/context.ts>Context#replyWithDice

The Telegram Bot Framework.
Very Popular
Latest
method Context.prototype.replyWithDice
import { Context } from "https://deno.land/x/grammy@v1.30.1/context.ts";

Context-aware alias for api.sendDice. Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.

Parameters

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<"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