-
-
Notifications
You must be signed in to change notification settings - Fork 69.4k
feat: Add Telegram sendDice support to message tool #25263
Copy link
Copy link
Closed as not planned
Labels
staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
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
Suggested Implementation
- Add
action: "dice"to the message tool (Telegram channel) - Accept optional
emojiparameter (default 🎲) - Return the
dice.valuein the tool result so the agent knows the outcome - Wire into
telegram-actions.tsand the bot module
Effort
Small — ~50 lines of code + tests. Single new action type, one Telegram API call.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Give feedbackNo fields configured for issues without a type.