mirror of
https://github.com/lukaszraczylo/go-telegram.git
synced 2026-06-05 22:43:59 +00:00
ac7cae8fa7
A fully-generated, strongly-typed Go client for the Telegram Bot API. * 176 methods + 301 types generated from Bot API v10.0 * 1408 auto-generated tests (8 scenarios per method) * Typed unions throughout — no 'any' in the public surface * Pluggable HTTP transport and JSON codec (default goccy/go-json) * Built-in retry middleware honouring Telegram's retry_after * Generic dispatcher with filters and conversation handlers * Self-verifying codegen pipeline (regen → audit → emit → run tests) * 14 example bots covering common patterns
61 lines
2.0 KiB
Cheetah
61 lines
2.0 KiB
Cheetah
// Code generated by cmd/genapi. DO NOT EDIT.
|
|
|
|
//go:build !ignore_autogenerated
|
|
|
|
package api
|
|
|
|
// ParseMode controls how Telegram interprets formatting in message text.
|
|
type ParseMode string
|
|
|
|
const (
|
|
ParseModeMarkdown ParseMode = "Markdown" // legacy
|
|
ParseModeMarkdownV2 ParseMode = "MarkdownV2"
|
|
ParseModeHTML ParseMode = "HTML"
|
|
)
|
|
|
|
// ChatType is the type of a Telegram chat.
|
|
type ChatType string
|
|
|
|
const (
|
|
ChatTypePrivate ChatType = "private"
|
|
ChatTypeGroup ChatType = "group"
|
|
ChatTypeSupergroup ChatType = "supergroup"
|
|
ChatTypeChannel ChatType = "channel"
|
|
)
|
|
|
|
// UpdateType identifies an Update payload variant. Used by allowed_updates
|
|
// in getUpdates / setWebhook.
|
|
type UpdateType string
|
|
|
|
const (
|
|
UpdateMessage UpdateType = "message"
|
|
UpdateEditedMessage UpdateType = "edited_message"
|
|
UpdateChannelPost UpdateType = "channel_post"
|
|
UpdateEditedChannelPost UpdateType = "edited_channel_post"
|
|
UpdateCallbackQuery UpdateType = "callback_query"
|
|
UpdateInlineQuery UpdateType = "inline_query"
|
|
)
|
|
|
|
// MessageEntityType is the kind of an entity (mention, hashtag, command, ...).
|
|
type MessageEntityType string
|
|
|
|
const (
|
|
EntityMention MessageEntityType = "mention"
|
|
EntityHashtag MessageEntityType = "hashtag"
|
|
EntityCashtag MessageEntityType = "cashtag"
|
|
EntityBotCommand MessageEntityType = "bot_command"
|
|
EntityURL MessageEntityType = "url"
|
|
EntityEmail MessageEntityType = "email"
|
|
EntityPhoneNumber MessageEntityType = "phone_number"
|
|
EntityBold MessageEntityType = "bold"
|
|
EntityItalic MessageEntityType = "italic"
|
|
EntityUnderline MessageEntityType = "underline"
|
|
EntityStrike MessageEntityType = "strikethrough"
|
|
EntitySpoiler MessageEntityType = "spoiler"
|
|
EntityCode MessageEntityType = "code"
|
|
EntityPre MessageEntityType = "pre"
|
|
EntityTextLink MessageEntityType = "text_link"
|
|
EntityTextMention MessageEntityType = "text_mention"
|
|
EntityCustomEmoji MessageEntityType = "custom_emoji"
|
|
)
|