telegram

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package telegram provides Telegram Bot API helpers for sending messages and managing interactions.

It wraps the go-telegram/bot library to send text messages, voice (OGG) messages, and emoji reactions. It also provides rendering helpers for interactive question pages with inline keyboards, used by the daemon to surface AskUserQuestion prompts from agent sessions to the human operator over Telegram.

Plane: shared

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseChatID

func ParseChatID(s string) (int64, error)

ParseChatID converts a string chat ID to int64.

func SendMessage

func SendMessage(botToken, chatID, text string) error

SendMessage sends a text message to a chat via the Telegram Bot API. Long messages are automatically split at natural boundaries to fit within Telegram's 4096-rune limit.

func SendVoice

func SendVoice(botToken string, chatID int64, oggData []byte) error

SendVoice sends an OGG audio file as a voice message via Telegram Bot API.

func SetReaction added in v1.0.0

func SetReaction(botToken string, chatID int64, messageID int, emoji string) error

SetReaction sets an emoji reaction on a Telegram message. Setting a new reaction replaces the previous one (Telegram API behavior).

func ToolEmoji added in v1.0.0

func ToolEmoji(toolName string) string

ToolEmoji maps a tool name to a Telegram-allowed reaction emoji. Returns empty string for tools that should not trigger a reaction. Allowed list: https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL