Skip to content

feat: Add Telegram sendDice support to message tool #25263

@zhivkoto

Description

@zhivkoto

Summary

The Telegram Bot API supports sendDice (since Bot API 4.7), which sends an animated dice/slot/bowling/etc emoji that resolves to a random value. This isn't currently supported in OpenClaw's Telegram provider.

Use Case

Bots in group chats can't participate in Telegram's native dice rolling. When a bot sends 🎲 as text, it's just an emoji — no animation, no random value. The sendDice method triggers Telegram's built-in animated dice with a server-determined random result.

Telegram API Reference

POST /bot<token>/sendDice
{
  chat_id: string | number,
  emoji: "🎲" | "🎯" | "🏀" | "⚽" | "🎳" | "🎰",  // optional, defaults to 🎲
  message_thread_id?: number,
  reply_parameters?: object,
  disable_notification?: boolean
}

Returns a Message object with dice.emoji and dice.value:

  • 🎲 → 1-6
  • 🎯 → 1-6
  • 🏀 → 1-5
  • ⚽ → 1-5
  • 🎳 → 1-6
  • 🎰 → 1-64

Docs: https://core.telegram.org/bots/api#senddice

Suggested Implementation

  • Add action: "dice" to the message tool (Telegram channel)
  • Accept optional emoji parameter (default 🎲)
  • Return the dice.value in the tool result so the agent knows the outcome
  • Wire into telegram-actions.ts and the bot module

Effort

Small — ~50 lines of code + tests. Single new action type, one Telegram API call.

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions