telegram

package
v1.5.9 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: MIT Imports: 19 Imported by: 0

README

Клиент Telegram бота.

Компонент основан на пакете https://github.com/go-telebot/telebot.

Объект конфигурации.
type Config struct {
	Token string

	ProxyHost string
	User      string
	Password  string

	Timeout               time.Duration
	KeepAlive             time.Duration
	IdleConnTimeout       time.Duration
	TLSHandshakeTimeout   time.Duration
	ExpectContinueTimeout time.Duration
	MaxIdleConns          uint16
	MaxIdleConnsPerHost   uint16
}

Описание полей:

Поле Описание Значение по умолчанию
Token Токен доступа телеграм бота, выдается самим телеграммном, этот параметр может быть передан одним из 3-х методов:
- флаг командной строки --telegram.token
- переменная окружения TELEGRAM_TOKEN
- значение в конфиг файле telegram.token
ProxyHost Хост прокси, если подключение к телеграм происходит через прокси, этот параметр может быть передан одним из 3-х методов:
- флаг командной строки --telegram.proxy.host
- переменная окружения TELEGRAM_PROXY_HOST
- значение в конфиг файле telegram.proxy.host
User Имя пользователя для авторизации в прокси, если подключение к телеграм происходит через прокси, этот параметр может быть передан одним из 3-х методов:
- флаг командной строки --telegram.proxy.auth.user
- переменная окружения TELEGRAM_PROXY_AUTH_USER
- значение в конфиг файле telegram.proxy.auth.user
Password Пароль пользователя для авторизации в прокси, если подключение к телеграм происходит через прокси, этот параметр может быть передан одним из 3-х методов:
- флаг командной строки --telegram.proxy.auth.password
- переменная окружения TELEGRAM_PROXY_AUTH_PASSWORD
- значение в конфиг файле telegram.proxy.auth.password
Timeout Таймаут подключения к прокси, если подключение к телеграм происходит через прокси, этот параметр может быть передан одним из 3-х методов:
- флаг командной строки --telegram.proxy.http.timeout
- переменная окружения TELEGRAM_PROXY_HTTP_TIMEOUT
- значение в конфиг файле telegram.proxy.http.timeout
KeepAlive Интервал отправки пакетов, подтверждения жизнеспособности соединения, если подключение к телеграм происходит через прокси, этот параметр может быть передан одним из 3-х методов:
- флаг командной строки --telegram.proxy.http.keep_alive
- переменная окружения TELEGRAM_PROXY_HTTP_KEEP_ALIVE
- значение в конфиг файле telegram.proxy.http.keep_alive
IdleConnTimeout Максимальное время бездействия активного соединения, если подключение к телеграм происходит через прокси, этот параметр может быть передан одним из 3-х методов:
- флаг командной строки --telegram.proxy.http.idle_conn_timeout
- переменная окружения TELEGRAM_PROXY_HTTP_IDLE_CONN_TIMEOUT
- значение в конфиг файле telegram.proxy.http.idle_conn_timeout
TLSHandshakeTimeout Максимальное время ожидания TLS, если подключение к телеграм происходит через прокси, этот параметр может быть передан одним из 3-х методов:
- флаг командной строки --telegram.proxy.http.tls_handshake_timeout
- переменная окружения TELEGRAM_PROXY_HTTP_TLS_HANDSHAKE_TIMEOUT
- значение в конфиг файле telegram.proxy.http.tls_handshake_timeout
MaxIdleConns Таймаут ожидания первых заголовков от прокси сервера, если подключение к телеграм происходит через прокси, этот параметр может быть передан одним из 3-х методов:
- флаг командной строки --telegram.proxy.http.expect_continue_timeout
- переменная окружения TELEGRAM_PROXY_HTTP_EXPECT_CONTINUE_TIMEOUT
- значение в конфиг файле telegram.proxy.http.expect_continue_timeout
ExpectContinueTimeout Максимальное кол. активных соединений, если подключение к телеграм происходит через прокси, этот параметр может быть передан одним из 3-х методов:
- флаг командной строки --telegram.proxy.http.max_idle_conns
- переменная окружения TELEGRAM_PROXY_HTTP_MAX_IDLE_CONNS
- значение в конфиг файле telegram.proxy.http.max_idle_conns

Documentation

Index

Constants

View Source
const (
	TokenFieldName                 = "telegram.token"
	ProxyHostFieldName             = "telegram.proxy.host"
	UserFieldName                  = "telegram.proxy.auth.user"
	PasswordFieldName              = "telegram.proxy.auth.password"
	TimeoutFieldName               = "telegram.proxy.http.timeout"
	KeepAliveFieldName             = "telegram.proxy.http.keep_alive"
	IdleConnTimeoutFieldName       = "telegram.proxy.http.idle_conn_timeout"
	TLSHandshakeTimeoutFieldName   = "telegram.proxy.http.tls_handshake_timeout"
	ExpectContinueTimeoutFieldName = "telegram.proxy.http.expect_continue_timeout"
	MaxIdleConnsFieldName          = "telegram.proxy.http.max_idle_conns"

	TimeoutDefault               = 30 * time.Second
	KeepAliveDefault             = 30 * time.Second
	IdleConnTimeoutDefault       = time.Minute
	TLSHandshakeTimeoutDefault   = 10 * time.Second
	ExpectContinueTimeoutDefault = time.Second
	MaxIdleConnsDefault          = uint16(10)
)

Variables

View Source
var Component = &app.Component{
	Dependencies: app.Components{
		logger.Component,
		configurator.Component,
		re_configuration.Component,
		info.Component,
	},
	Constructor: func(container container.Container) error {
		return container.Provides(
			NewConfig,
			NewReConfigurationWithConfigurator,
			func(client *ReConfiguration) Telegram { return client },
		)
	},
	BindFlags: func(flagSet *pflag.FlagSet, container container.Container) error {
		return container.Invoke(func(config *Config) {
			flagSet.StringVar(&config.Token, TokenFieldName, "", "telegram bot access token")
			flagSet.StringVar(&config.ProxyHost, ProxyHostFieldName, "", "proxy host to connect to telegram")
			flagSet.StringVar(&config.User, UserFieldName, "", "user for authorization in the proxy server")
			flagSet.StringVar(&config.Password, PasswordFieldName, "", "password for authorization in the proxy server")
			flagSet.DurationVar(&config.Timeout, TimeoutFieldName, TimeoutDefault, "host connection timeout")
			flagSet.DurationVar(&config.KeepAlive, KeepAliveFieldName, KeepAliveDefault, "period between keepalive messages")
			flagSet.DurationVar(&config.IdleConnTimeout, IdleConnTimeoutFieldName, IdleConnTimeoutDefault, "the maximum amount of time an idle")
			flagSet.DurationVar(&config.TLSHandshakeTimeout, TLSHandshakeTimeoutFieldName, TLSHandshakeTimeoutDefault, "maximum TLS handshake timeout")
			flagSet.DurationVar(&config.ExpectContinueTimeout, ExpectContinueTimeoutFieldName, ExpectContinueTimeoutDefault, "the amount of time to wait for the first server response headers after a complete write of the request headers")
			flagSet.Uint16Var(&config.MaxIdleConns, MaxIdleConnsFieldName, MaxIdleConnsDefault, "total maximum number of idle (keep-alive) connections")
		})
	},
	Serve: func(c container.Container) error {
		client, err := container.Get[*ReConfiguration](c)
		if err != nil {
			return err
		}

		reConfiguration, err := container.Get[configurator.ReConfiguration](c)
		if err != nil {
			return err
		}

		closer, err := container.Get[closer.Closer](c)
		if err != nil {
			return err
		}

		informer, err := container.Get[logger.Informer](c)
		if err != nil {
			return err
		}

		reConfiguration.Registration(client)
		informer.Info("telegram: registration in the reConfigurator")

		info, err := container.Get[info.Info](c)
		if err != nil {
			return err
		}

		config, err := container.Get[*Config](c)
		if err != nil {
			return err
		}

		info.Registration("telegram", config)

		ctx, cancelFunc := context.WithCancel(closer.GetContext())
		defer cancelFunc()

		informer.Infof("telegram.bot: started")
		go client.Start()

		<-ctx.Done()

		client.Stop()

		informer.Infof("telegram.bot: shutdown")
		return nil
	},
}

Functions

func New

func New(config *Config, logger logger.Logger) (*telebot.Bot, error)

func NewWithConfigurator

func NewWithConfigurator(config *Config, configurator configurator.Configurator, logger logger.Logger) (*telebot.Bot, error)

Types

type Builder

type Builder interface {
	ReBuild(client *telebot.Bot)
}

type Config

type Config struct {
	Token string `info:"secret"`

	ProxyHost string
	User      string
	Password  string `info:"secret"`

	Timeout               time.Duration
	KeepAlive             time.Duration
	IdleConnTimeout       time.Duration
	TLSHandshakeTimeout   time.Duration
	ExpectContinueTimeout time.Duration
	MaxIdleConns          uint16
}

func Configuration

func Configuration(config *Config, configurator configurator.Configurator) *Config

func NewConfig

func NewConfig() *Config

type Group

type Group interface {
	Use(middlewares ...telebot.MiddlewareFunc)
	Handle(endpoint interface{}, handlerFunc telebot.HandlerFunc, middlewares ...telebot.MiddlewareFunc)
}

type ReConfiguration

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

func NewReConfiguration

func NewReConfiguration(client *telebot.Bot, logger logger.Logger, config *Config) *ReConfiguration

func NewReConfigurationWithConfigurator

func NewReConfigurationWithConfigurator(config *Config, configurator configurator.Configurator, logger logger.Logger) (*ReConfiguration, error)

func (*ReConfiguration) Accept

func (reConfiguration *ReConfiguration) Accept(query *telebot.PreCheckoutQuery, errorMessage ...string) error

func (*ReConfiguration) AddSticker

func (reConfiguration *ReConfiguration) AddSticker(to telebot.Recipient, s telebot.StickerSet) error

func (*ReConfiguration) AdminsOf

func (reConfiguration *ReConfiguration) AdminsOf(chat *telebot.Chat) ([]telebot.ChatMember, error)

func (*ReConfiguration) Answer

func (reConfiguration *ReConfiguration) Answer(query *telebot.Query, resp *telebot.QueryResponse) error

func (*ReConfiguration) AnswerWebApp

func (reConfiguration *ReConfiguration) AnswerWebApp(query *telebot.Query, r telebot.Result) (*telebot.WebAppMessage, error)

func (*ReConfiguration) ApproveJoinRequest

func (reConfiguration *ReConfiguration) ApproveJoinRequest(chat telebot.Recipient, user *telebot.User) error

func (*ReConfiguration) Ban

func (reConfiguration *ReConfiguration) Ban(chat *telebot.Chat, member *telebot.ChatMember, revokeMessages ...bool) error

func (*ReConfiguration) BanSenderChat

func (reConfiguration *ReConfiguration) BanSenderChat(chat *telebot.Chat, sender telebot.Recipient) error

func (*ReConfiguration) ChatByID

func (reConfiguration *ReConfiguration) ChatByID(id int64) (*telebot.Chat, error)

func (*ReConfiguration) ChatByUsername

func (reConfiguration *ReConfiguration) ChatByUsername(name string) (*telebot.Chat, error)

func (*ReConfiguration) ChatMemberOf

func (reConfiguration *ReConfiguration) ChatMemberOf(chat, user telebot.Recipient) (*telebot.ChatMember, error)

func (*ReConfiguration) Client

func (reConfiguration *ReConfiguration) Client() *telebot.Bot

func (*ReConfiguration) Close

func (reConfiguration *ReConfiguration) Close() (bool, error)

func (*ReConfiguration) Commands

func (reConfiguration *ReConfiguration) Commands(opts ...interface{}) ([]telebot.Command, error)

func (*ReConfiguration) Copy

func (reConfiguration *ReConfiguration) Copy(to telebot.Recipient, msg telebot.Editable, options ...interface{}) (*telebot.Message, error)
func (reConfiguration *ReConfiguration) CreateInviteLink(chat telebot.Recipient, link *telebot.ChatInviteLink) (*telebot.ChatInviteLink, error)
func (reConfiguration *ReConfiguration) CreateInvoiceLink(i telebot.Invoice) (string, error)

func (*ReConfiguration) CreateStickerSet

func (reConfiguration *ReConfiguration) CreateStickerSet(to telebot.Recipient, s telebot.StickerSet) error

func (*ReConfiguration) CustomEmojiStickers

func (reConfiguration *ReConfiguration) CustomEmojiStickers(ids []string) ([]telebot.Sticker, error)

func (*ReConfiguration) DeclineJoinRequest

func (reConfiguration *ReConfiguration) DeclineJoinRequest(chat telebot.Recipient, user *telebot.User) error

func (*ReConfiguration) DefaultRights

func (reConfiguration *ReConfiguration) DefaultRights(forChannels bool) (*telebot.Rights, error)

func (*ReConfiguration) Delete

func (reConfiguration *ReConfiguration) Delete(msg telebot.Editable) error

func (*ReConfiguration) DeleteCommands

func (reConfiguration *ReConfiguration) DeleteCommands(opts ...interface{}) error

func (*ReConfiguration) DeleteGroupPhoto

func (reConfiguration *ReConfiguration) DeleteGroupPhoto(chat *telebot.Chat) error

func (*ReConfiguration) DeleteGroupStickerSet

func (reConfiguration *ReConfiguration) DeleteGroupStickerSet(chat *telebot.Chat) error

func (*ReConfiguration) DeleteSticker

func (reConfiguration *ReConfiguration) DeleteSticker(sticker string) error

func (*ReConfiguration) Download

func (reConfiguration *ReConfiguration) Download(file *telebot.File, localFilename string) error

func (*ReConfiguration) Edit

func (reConfiguration *ReConfiguration) Edit(msg telebot.Editable, what interface{}, opts ...interface{}) (*telebot.Message, error)

func (*ReConfiguration) EditCaption

func (reConfiguration *ReConfiguration) EditCaption(msg telebot.Editable, caption string, opts ...interface{}) (*telebot.Message, error)
func (reConfiguration *ReConfiguration) EditInviteLink(chat telebot.Recipient, link *telebot.ChatInviteLink) (*telebot.ChatInviteLink, error)

func (*ReConfiguration) EditMedia

func (reConfiguration *ReConfiguration) EditMedia(msg telebot.Editable, media telebot.Inputtable, opts ...interface{}) (*telebot.Message, error)

func (*ReConfiguration) EditReplyMarkup

func (reConfiguration *ReConfiguration) EditReplyMarkup(msg telebot.Editable, markup *telebot.ReplyMarkup) (*telebot.Message, error)

func (*ReConfiguration) File

func (reConfiguration *ReConfiguration) File(file *telebot.File) (io.ReadCloser, error)

func (*ReConfiguration) FileByID

func (reConfiguration *ReConfiguration) FileByID(fileID string) (telebot.File, error)

func (*ReConfiguration) Forward

func (reConfiguration *ReConfiguration) Forward(to telebot.Recipient, msg telebot.Editable, opts ...interface{}) (*telebot.Message, error)

func (*ReConfiguration) GameScores

func (reConfiguration *ReConfiguration) GameScores(user telebot.Recipient, msg telebot.Editable) ([]telebot.GameHighScore, error)

func (*ReConfiguration) Group

func (reConfiguration *ReConfiguration) Group(name string) Group

func (*ReConfiguration) Handle

func (reConfiguration *ReConfiguration) Handle(endpoint interface{}, h telebot.HandlerFunc, m ...telebot.MiddlewareFunc)
func (reConfiguration *ReConfiguration) InviteLink(chat *telebot.Chat) (string, error)

func (*ReConfiguration) Leave

func (reConfiguration *ReConfiguration) Leave(chat *telebot.Chat) error

func (*ReConfiguration) Len

func (reConfiguration *ReConfiguration) Len(chat *telebot.Chat) (int, error)

func (*ReConfiguration) Logout

func (reConfiguration *ReConfiguration) Logout() (bool, error)

func (*ReConfiguration) Me

func (reConfiguration *ReConfiguration) Me() *telebot.User

func (*ReConfiguration) MenuButton

func (reConfiguration *ReConfiguration) MenuButton(chat *telebot.User) (*telebot.MenuButton, error)

func (*ReConfiguration) NewContext

func (reConfiguration *ReConfiguration) NewContext(u telebot.Update) telebot.Context

func (*ReConfiguration) NewMarkup

func (reConfiguration *ReConfiguration) NewMarkup() *telebot.ReplyMarkup

func (*ReConfiguration) Notify

func (reConfiguration *ReConfiguration) Notify(to telebot.Recipient, action telebot.ChatAction) error

func (*ReConfiguration) OnError

func (reConfiguration *ReConfiguration) OnError(err error, c telebot.Context)

func (*ReConfiguration) Pin

func (reConfiguration *ReConfiguration) Pin(msg telebot.Editable, opts ...interface{}) error

func (*ReConfiguration) ProcessUpdate

func (reConfiguration *ReConfiguration) ProcessUpdate(u telebot.Update)

func (*ReConfiguration) ProfilePhotosOf

func (reConfiguration *ReConfiguration) ProfilePhotosOf(user *telebot.User) ([]telebot.Photo, error)

func (*ReConfiguration) Promote

func (reConfiguration *ReConfiguration) Promote(chat *telebot.Chat, member *telebot.ChatMember) error

func (*ReConfiguration) Raw

func (reConfiguration *ReConfiguration) Raw(method string, payload interface{}) ([]byte, error)

func (*ReConfiguration) ReConfiguration

func (reConfiguration *ReConfiguration) ReConfiguration(configurator configurator.Configurator) error

func (*ReConfiguration) RemoveWebhook

func (reConfiguration *ReConfiguration) RemoveWebhook(dropPending ...bool) error

func (*ReConfiguration) Reply

func (reConfiguration *ReConfiguration) Reply(to *telebot.Message, what interface{}, opts ...interface{}) (*telebot.Message, error)

func (*ReConfiguration) Respond

func (reConfiguration *ReConfiguration) Respond(c *telebot.Callback, resp ...*telebot.CallbackResponse) error

func (*ReConfiguration) Restrict

func (reConfiguration *ReConfiguration) Restrict(chat *telebot.Chat, member *telebot.ChatMember) error
func (reConfiguration *ReConfiguration) RevokeInviteLink(chat telebot.Recipient, link string) (*telebot.ChatInviteLink, error)

func (*ReConfiguration) Send

func (reConfiguration *ReConfiguration) Send(to telebot.Recipient, what interface{}, opts ...interface{}) (*telebot.Message, error)

func (*ReConfiguration) SendAlbum

func (reConfiguration *ReConfiguration) SendAlbum(to telebot.Recipient, a telebot.Album, opts ...interface{}) ([]telebot.Message, error)

func (*ReConfiguration) SetAdminTitle

func (reConfiguration *ReConfiguration) SetAdminTitle(chat *telebot.Chat, user *telebot.User, title string) error

func (*ReConfiguration) SetCommands

func (reConfiguration *ReConfiguration) SetCommands(opts ...interface{}) error

func (*ReConfiguration) SetDefaultRights

func (reConfiguration *ReConfiguration) SetDefaultRights(rights telebot.Rights, forChannels bool) error

func (*ReConfiguration) SetGameScore

func (reConfiguration *ReConfiguration) SetGameScore(user telebot.Recipient, msg telebot.Editable, score telebot.GameHighScore) (*telebot.Message, error)

func (*ReConfiguration) SetGroupDescription

func (reConfiguration *ReConfiguration) SetGroupDescription(chat *telebot.Chat, description string) error

func (*ReConfiguration) SetGroupPermissions

func (reConfiguration *ReConfiguration) SetGroupPermissions(chat *telebot.Chat, perms telebot.Rights) error

func (*ReConfiguration) SetGroupPhoto

func (reConfiguration *ReConfiguration) SetGroupPhoto(chat *telebot.Chat, p *telebot.Photo) error

func (*ReConfiguration) SetGroupStickerSet

func (reConfiguration *ReConfiguration) SetGroupStickerSet(chat *telebot.Chat, setName string) error

func (*ReConfiguration) SetGroupTitle

func (reConfiguration *ReConfiguration) SetGroupTitle(chat *telebot.Chat, title string) error

func (*ReConfiguration) SetMenuButton

func (reConfiguration *ReConfiguration) SetMenuButton(chat *telebot.User, mb interface{}) error

func (*ReConfiguration) SetStickerPosition

func (reConfiguration *ReConfiguration) SetStickerPosition(sticker string, position int) error

func (*ReConfiguration) SetStickerSetThumb

func (reConfiguration *ReConfiguration) SetStickerSetThumb(to telebot.Recipient, s telebot.StickerSet) error

func (*ReConfiguration) SetWebhook

func (reConfiguration *ReConfiguration) SetWebhook(w *telebot.Webhook) error

func (*ReConfiguration) Ship

func (reConfiguration *ReConfiguration) Ship(query *telebot.ShippingQuery, what ...interface{}) error

func (*ReConfiguration) Start

func (reConfiguration *ReConfiguration) Start()

func (*ReConfiguration) StickerSet

func (reConfiguration *ReConfiguration) StickerSet(name string) (*telebot.StickerSet, error)

func (*ReConfiguration) Stop

func (reConfiguration *ReConfiguration) Stop()

func (*ReConfiguration) StopLiveLocation

func (reConfiguration *ReConfiguration) StopLiveLocation(msg telebot.Editable, opts ...interface{}) (*telebot.Message, error)

func (*ReConfiguration) StopPoll

func (reConfiguration *ReConfiguration) StopPoll(msg telebot.Editable, opts ...interface{}) (*telebot.Poll, error)

func (*ReConfiguration) Unban

func (reConfiguration *ReConfiguration) Unban(chat *telebot.Chat, user *telebot.User, forBanned ...bool) error

func (*ReConfiguration) UnbanSenderChat

func (reConfiguration *ReConfiguration) UnbanSenderChat(chat *telebot.Chat, sender telebot.Recipient) error

func (*ReConfiguration) Unpin

func (reConfiguration *ReConfiguration) Unpin(chat *telebot.Chat, messageID ...int) error

func (*ReConfiguration) UnpinAll

func (reConfiguration *ReConfiguration) UnpinAll(chat *telebot.Chat) error

func (*ReConfiguration) UploadSticker

func (reConfiguration *ReConfiguration) UploadSticker(to telebot.Recipient, png *telebot.File) (*telebot.File, error)

func (*ReConfiguration) Use

func (reConfiguration *ReConfiguration) Use(middlewares ...telebot.MiddlewareFunc)

func (*ReConfiguration) Webhook

func (reConfiguration *ReConfiguration) Webhook() (*telebot.Webhook, error)

type Telegram

type Telegram interface {
	AdminsOf(chat *telebot.Chat) ([]telebot.ChatMember, error)
	Ban(chat *telebot.Chat, member *telebot.ChatMember, revokeMessages ...bool) error
	BanSenderChat(chat *telebot.Chat, sender telebot.Recipient) error
	DefaultRights(forChannels bool) (*telebot.Rights, error)
	Len(chat *telebot.Chat) (int, error)
	Promote(chat *telebot.Chat, member *telebot.ChatMember) error
	Restrict(chat *telebot.Chat, member *telebot.ChatMember) error
	SetAdminTitle(chat *telebot.Chat, user *telebot.User, title string) error
	SetDefaultRights(rights telebot.Rights, forChannels bool) error
	Unban(chat *telebot.Chat, user *telebot.User, forBanned ...bool) error
	UnbanSenderChat(chat *telebot.Chat, sender telebot.Recipient) error
	Raw(method string, payload interface{}) ([]byte, error)
	Accept(query *telebot.PreCheckoutQuery, errorMessage ...string) error
	Answer(query *telebot.Query, resp *telebot.QueryResponse) error
	AnswerWebApp(query *telebot.Query, r telebot.Result) (*telebot.WebAppMessage, error)
	ChatByID(id int64) (*telebot.Chat, error)
	ChatByUsername(name string) (*telebot.Chat, error)
	ChatMemberOf(chat, user telebot.Recipient) (*telebot.ChatMember, error)
	Close() (bool, error)
	Copy(to telebot.Recipient, msg telebot.Editable, options ...interface{}) (*telebot.Message, error)
	Delete(msg telebot.Editable) error
	Download(file *telebot.File, localFilename string) error
	Edit(msg telebot.Editable, what interface{}, opts ...interface{}) (*telebot.Message, error)
	EditCaption(msg telebot.Editable, caption string, opts ...interface{}) (*telebot.Message, error)
	EditMedia(msg telebot.Editable, media telebot.Inputtable, opts ...interface{}) (*telebot.Message, error)
	EditReplyMarkup(msg telebot.Editable, markup *telebot.ReplyMarkup) (*telebot.Message, error)
	File(file *telebot.File) (io.ReadCloser, error)
	FileByID(fileID string) (telebot.File, error)
	Forward(to telebot.Recipient, msg telebot.Editable, opts ...interface{}) (*telebot.Message, error)
	Group(name string) Group
	Handle(endpoint interface{}, h telebot.HandlerFunc, m ...telebot.MiddlewareFunc)
	Leave(chat *telebot.Chat) error
	Logout() (bool, error)
	MenuButton(chat *telebot.User) (*telebot.MenuButton, error)
	NewContext(u telebot.Update) telebot.Context
	NewMarkup() *telebot.ReplyMarkup
	Notify(to telebot.Recipient, action telebot.ChatAction) error
	OnError(err error, c telebot.Context)
	Pin(msg telebot.Editable, opts ...interface{}) error
	ProfilePhotosOf(user *telebot.User) ([]telebot.Photo, error)
	Reply(to *telebot.Message, what interface{}, opts ...interface{}) (*telebot.Message, error)
	Respond(c *telebot.Callback, resp ...*telebot.CallbackResponse) error
	Send(to telebot.Recipient, what interface{}, opts ...interface{}) (*telebot.Message, error)
	SendAlbum(to telebot.Recipient, a telebot.Album, opts ...interface{}) ([]telebot.Message, error)
	SetMenuButton(chat *telebot.User, mb interface{}) error
	Ship(query *telebot.ShippingQuery, what ...interface{}) error
	Start()
	Stop()
	StopLiveLocation(msg telebot.Editable, opts ...interface{}) (*telebot.Message, error)
	StopPoll(msg telebot.Editable, opts ...interface{}) (*telebot.Poll, error)
	Unpin(chat *telebot.Chat, messageID ...int) error
	UnpinAll(chat *telebot.Chat) error
	Use(middleware ...telebot.MiddlewareFunc)
	ApproveJoinRequest(chat telebot.Recipient, user *telebot.User) error
	CreateInviteLink(chat telebot.Recipient, link *telebot.ChatInviteLink) (*telebot.ChatInviteLink, error)
	DeclineJoinRequest(chat telebot.Recipient, user *telebot.User) error
	DeleteGroupPhoto(chat *telebot.Chat) error
	DeleteGroupStickerSet(chat *telebot.Chat) error
	EditInviteLink(chat telebot.Recipient, link *telebot.ChatInviteLink) (*telebot.ChatInviteLink, error)
	InviteLink(chat *telebot.Chat) (string, error)
	RevokeInviteLink(chat telebot.Recipient, link string) (*telebot.ChatInviteLink, error)
	SetGroupDescription(chat *telebot.Chat, description string) error
	SetGroupPermissions(chat *telebot.Chat, perms telebot.Rights) error
	SetGroupPhoto(chat *telebot.Chat, p *telebot.Photo) error
	SetGroupStickerSet(chat *telebot.Chat, setName string) error
	SetGroupTitle(chat *telebot.Chat, title string) error
	Commands(opts ...interface{}) ([]telebot.Command, error)
	DeleteCommands(opts ...interface{}) error
	SetCommands(opts ...interface{}) error
	GameScores(user telebot.Recipient, msg telebot.Editable) ([]telebot.GameHighScore, error)
	SetGameScore(user telebot.Recipient, msg telebot.Editable, score telebot.GameHighScore) (*telebot.Message, error)
	CreateInvoiceLink(i telebot.Invoice) (string, error)
	AddSticker(to telebot.Recipient, s telebot.StickerSet) error
	CreateStickerSet(to telebot.Recipient, s telebot.StickerSet) error
	CustomEmojiStickers(ids []string) ([]telebot.Sticker, error)
	DeleteSticker(sticker string) error
	SetStickerPosition(sticker string, position int) error
	SetStickerSetThumb(to telebot.Recipient, s telebot.StickerSet) error
	StickerSet(name string) (*telebot.StickerSet, error)
	UploadSticker(to telebot.Recipient, png *telebot.File) (*telebot.File, error)
	ProcessUpdate(u telebot.Update)
	RemoveWebhook(dropPending ...bool) error
	SetWebhook(w *telebot.Webhook) error
	Webhook() (*telebot.Webhook, error)
	Me() *telebot.User
}

Jump to

Keyboard shortcuts

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