Documentation
¶
Index ¶
- type Bot
- func (bot *Bot) Api() *tg_bot.BotApi
- func (bot *Bot) ClearAllCommands() error
- func (bot *Bot) RegisterCommands(commands ...tg_bot.BotCommand) error
- func (bot *Bot) Send(msg tg_bot.Chattable) error
- func (bot *Bot) Serve(ctx context.Context) error
- func (bot *Bot) Shutdown()
- func (bot *Bot) UpgradeConfig(logCtx context.Context, cfg Config) error
- func (bot *Bot) UpgradeMux(logCtx context.Context, mux Muxer)
- type CommandDescription
- type Config
- type Muxer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct {
// contains filtered or unexported fields
}
func (*Bot) ClearAllCommands ¶
func (*Bot) RegisterCommands ¶
func (bot *Bot) RegisterCommands(commands ...tg_bot.BotCommand) error
type CommandDescription ¶
type Config ¶
type Config struct {
Token string `schema:"Токен для бота" validate:"required,min=1" yamlschema:"secret"`
PaymentToken string `schema:"Токен для интеграции с платёжной платформой" yamlschema:"secret"`
// timeout in seconds
Timeout int `schema:"Время получения сообщений от сервера" validate:"required,min=1,max=1000"`
Limit int `schema:"Количество читаемых сообщений за раз" validate:"required,min=1,max=1000"`
AllowedUpdates []string `schema:"Типы сообщений для получения ботом"`
ApiEndpoint string
RetryDelaySec int `schema:"Время через которое повторится обработка сообщений, в секундах"` // default = 3
MaxRetryCount int `schema:"Максимальное количество повторений обработки сообщений"` // -1 - infinity retry count
}
Click to show internal directories.
Click to hide internal directories.