Send Dice

import { IContext, IMessage } from 'degreet-telegram/src/types'

bot.command('start', async (ctx: IContext): Promise<any> => {
  try {
    const result: IMessage = await ctx.answer.sendDice('🎯')
    console.log(result.dice) // { emoji: '🎯', value: 1 (1-6, 6 as max) }
  } catch (e: any) {
    console.error(e)
  }
})

bot.on('dice', console.log) // when user drop dice

Supported dice emojis: 🎲 🎯 🏀 ⚽ 🎳 🎰

Last updated