Documentation
¶
Overview ¶
Package telegram provides a small Telegram Bot API client for sending messages, polling updates, restricting allowed users, and parsing commands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseCommand ¶
ParseCommand extracts the command and arguments from a message text. Returns empty strings if the message is not a command. Example: "/anki some text here" → "anki", "some text here"
Types ¶
type Chat ¶
type Chat struct {
ID int64 `json:"id"`
}
Chat identifies the Telegram chat where a message was sent.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Telegram Bot API client.
func New ¶
New creates a Telegram bot client. allowedUserIDs restricts who can interact with the bot. If empty, all users are allowed.
type Message ¶
type Message struct {
MessageID int `json:"message_id"`
Chat Chat `json:"chat"`
From *User `json:"from"`
Text string `json:"text"`
}
Message is the message payload attached to a Telegram update.
Click to show internal directories.
Click to hide internal directories.