tgbotserver

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const PluginName = "tgbotserver"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Mode Mode `mapstructure:"mode"`
}

func (*Config) InitDefault

func (cfg *Config) InitDefault()

type Mode

type Mode string

Mode represents available telegram bot server modes

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

func (*Plugin) Init

func (p *Plugin) Init(cfg config.Configurer, bot *tgbotapi.BotAPI, client *asynq.Client, log *zap.Logger) error

func (*Plugin) Name

func (p *Plugin) Name() string

Name returns user-friendly plugin name

func (*Plugin) Serve

func (p *Plugin) Serve() chan error

func (*Plugin) Stop

func (p *Plugin) Stop() error

type PollingConfig

type PollingConfig struct {
	Offset         int      `mapstructure:"offset"`
	Limit          int      `mapstructure:"limit"`
	Timeout        int      `mapstructure:"timeout"`
	AllowedUpdates []string `mapstructure:"allowed_updates"`
}

func (*PollingConfig) BuildUpdateConfig

func (cfg *PollingConfig) BuildUpdateConfig() tgbotapi.UpdateConfig

func (*PollingConfig) InitDefault

func (cfg *PollingConfig) InitDefault()

type WebhookConfig

type WebhookConfig struct {
	URL                string   `mapstructure:"url"`
	Certificate        string   `mapstructure:"certificate"`
	IPAddress          string   `mapstructure:"ip"`
	AllowedUpdates     []string `mapstructure:"allowed_updates"`
	MaxConnections     int      `mapstructure:"max_connections"`
	DropPendingUpdates bool     `mapstructure:"drop_pending_updates"`
}

func (*WebhookConfig) BuildWebhookConfig

func (cfg *WebhookConfig) BuildWebhookConfig() (tgbotapi.WebhookConfig, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL