Documentation ¶
Index ¶
- Constants
- Variables
- type Bot
- func (bot *Bot) AnswerCallback(upd *Update, text string, alert bool) error
- func (bot *Bot) CallbackQuery(name string, h Handler)
- func (bot *Bot) Command(name string, h Handler)
- func (bot *Bot) DefaultHandler() Handler
- func (bot *Bot) InlineQuery(query string, h Handler)
- func (bot *Bot) Message(msg string, h Handler)
- func (bot *Bot) SendMessage(ctx *Context, text string, markup *tgbotapi.InlineKeyboardMarkup) error
- func (bot *Bot) SendSticker(ctx *Context, stickerID string) error
- func (bot *Bot) Serve(h Handler)
- func (bot *Bot) Stop()
- func (bot *Bot) UpdateCallbackQueryMessage(upd *Update, caption, text string, markup *tgbotapi.InlineKeyboardMarkup) error
- func (bot *Bot) Updates() <-chan *Update
- type BotConfig
- type Context
- type Handler
- type HandlerFunc
- type Update
- func (upd *Update) CallbackQuery() string
- func (upd *Update) Chat() *tgbotapi.Chat
- func (upd *Update) Command() string
- func (upd *Update) CommandArgs() string
- func (upd *Update) InlineQuery() string
- func (upd *Update) IsCallbackQuery() bool
- func (upd *Update) IsCommand() bool
- func (upd *Update) IsInlineQuery() bool
- func (upd *Update) User() *tgbotapi.User
Constants ¶
View Source
const ( EnvCert = "TG_BOT_CERT" EnvDomain = "TG_BOT_DOMAIN" EnvKey = "TG_BOT_KEY" EnvSecret = "TG_BOT_SECRET" EnvToken = "TG_BOT_TOKEN" EnvProxyURL = "TG_BOT_PROXY_URL" )
Variables ¶
View Source
var ( ErrNoBotCert = errors.New("Please, provide path to valid SSL certificate for Telegram bot.") ErrNoBotKey = errors.New("Please, provide path to valid SSL key for Telegram bot.") ErrNoBotSecret = errors.New("Please, provide Telegram bot secret with TG_BOT_SECRET environment variable.") ErrNoBotToken = errors.New("Please, provide Telegram bot token with TG_BOT_TOKEN environment variable.") )
View Source
var ( StickerMinecraftFabulous = "CAADAgADsQMAAvJ-ggzCPqB_xrc8iwI" StickerMinecraftForeverAlone = "CAADAgADvAMAAvJ-ggyCesS6rGVfFgI" StickerCriminalRaccoonHat = "CAADAgADlwYAAvoLtgiTap3uNdUieAI" )
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct { *tgbotapi.BotAPI Storage storage.BotStorage // contains filtered or unexported fields }
func (*Bot) AnswerCallback ¶
func (*Bot) CallbackQuery ¶
func (*Bot) DefaultHandler ¶
func (*Bot) InlineQuery ¶
func (*Bot) SendMessage ¶
func (*Bot) UpdateCallbackQueryMessage ¶
type BotConfig ¶
type BotConfig struct {
// contains filtered or unexported fields
}
func ConfigFromEnv ¶
type HandlerFunc ¶
func (HandlerFunc) HandleUpdate ¶
func (fn HandlerFunc) HandleUpdate(ctx *Context) error
type Update ¶
type Update struct { *tgbotapi.Update // contains filtered or unexported fields }
func (*Update) CallbackQuery ¶
func (*Update) CommandArgs ¶
func (*Update) InlineQuery ¶
func (*Update) IsCallbackQuery ¶
func (*Update) IsInlineQuery ¶
Click to show internal directories.
Click to hide internal directories.