Documentation
¶
Index ¶
- Constants
- Variables
- func Do(ctx context.Context, token, op string, ...) error
- func IsTransient(err error) bool
- func ParseCommand(text string) (cmd, arg string)
- func Submit(token string, job Job) error
- type APIError
- type Bot
- func (b *Bot) AnswerCallback(ctx context.Context, callbackID string) error
- func (b *Bot) BotID() string
- func (b *Bot) Check(ctx context.Context) (string, error)
- func (b *Bot) Configured() bool
- func (b *Bot) DeepLink(startToken string) string
- func (b *Bot) GetChat(ctx context.Context, chatID string) (ChatInfo, error)
- func (b *Bot) GetMe(ctx context.Context) (BotInfo, error)
- func (b *Bot) ResolveChatID(ctx context.Context, handleOrID string) (string, error)
- func (b *Bot) SendFile(ctx context.Context, chatID, method, field, filePath, caption string) error
- func (b *Bot) SendHTML(ctx context.Context, chatID, text string) error
- func (b *Bot) SendHTMLRaw(ctx context.Context, chatID, text string) error
- func (b *Bot) SendMarkdown(ctx context.Context, chatID, text string) error
- func (b *Bot) SendMessage(ctx context.Context, chatID, text string) error
- func (b *Bot) SendMessageButtons(ctx context.Context, chatID, text string, buttons []Button) (int64, error)
- func (b *Bot) SendMessageID(ctx context.Context, chatID, text string) (int64, error)
- func (b *Bot) SendPayload(ctx context.Context, chatID string, payload map[string]any) (int64, error)
- func (b *Bot) SendPhotoHTML(ctx context.Context, chatID, photoURL, caption string) error
- func (b *Bot) SendWithMode(ctx context.Context, chatID, text, parseMode string) error
- func (b *Bot) SetWebhook(ctx context.Context, webhookURL string) error
- func (b *Bot) VerifyLogin(vals url.Values) (LoginData, error)
- func (b *Bot) VerifyWebhook(r *http.Request) bool
- type BotInfo
- type Button
- type CallbackQuery
- type Chat
- type ChatInfo
- type Job
- type LoginData
- type Message
- type Update
- type User
Constants ¶
View Source
const MaxCaption = 1024
Variables ¶
View Source
var ( ErrNotConfigured = errors.New("telegram bot is not configured") ErrBotBlocked = errors.New("telegram: bot was blocked by the user or the chat is gone") ErrBadLogin = errors.New("telegram login data is invalid or expired") )
View Source
var ErrQueueFull = errors.New("telegram: send queue for this bot is full")
Functions ¶
func IsTransient ¶
func ParseCommand ¶
Types ¶
type Bot ¶
type Bot struct {
Token string
Username string
Secret string
API string
// contains filtered or unexported fields
}
func (*Bot) AnswerCallback ¶
func (*Bot) Configured ¶
func (*Bot) ResolveChatID ¶
func (*Bot) SendMarkdown ¶
func (*Bot) SendMessageButtons ¶
func (*Bot) SendMessageID ¶
func (*Bot) SendPayload ¶
func (*Bot) SendPhotoHTML ¶
func (*Bot) SendWithMode ¶
type CallbackQuery ¶
type LoginData ¶
type LoginData struct {
ID int64
Username string
FirstName string
LastName string
AuthDate time.Time
}
func (LoginData) DisplayName ¶
type Update ¶
type Update struct {
UpdateID int64 `json:"update_id"`
Message *Message `json:"message"`
CallbackQuery *CallbackQuery `json:"callback_query"`
}
Click to show internal directories.
Click to hide internal directories.