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
- type RetryWithDelayError
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:"Токен для бота,secret" validate:"required,min=1"`
PaymentToken string `schema:"Токен для интеграции с платёжной платформой,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
}
type RetryWithDelayError ¶ added in v1.7.0
type RetryWithDelayError struct {
// contains filtered or unexported fields
}
func NewRetryWithDelayError ¶ added in v1.7.0
func NewRetryWithDelayError(msg string) RetryWithDelayError
func (RetryWithDelayError) Error ¶ added in v1.7.0
func (e RetryWithDelayError) Error() string
Click to show internal directories.
Click to hide internal directories.