Documentation ¶
Index ¶
- Constants
- Variables
- func New(config *Config, logger logger.Logger) (*telebot.Bot, error)
- func NewWithConfigurator(config *Config, configurator configurator.Configurator, logger logger.Logger) (*telebot.Bot, error)
- type Builder
- type Config
- type Group
- type Process
- type ReConfiguration
- func (reConfiguration *ReConfiguration) Accept(query *telebot.PreCheckoutQuery, errorMessage ...string) error
- func (reConfiguration *ReConfiguration) AddSticker(to telebot.Recipient, s telebot.StickerSet) error
- func (reConfiguration *ReConfiguration) AdminsOf(chat *telebot.Chat) ([]telebot.ChatMember, error)
- func (reConfiguration *ReConfiguration) Answer(query *telebot.Query, resp *telebot.QueryResponse) error
- func (reConfiguration *ReConfiguration) AnswerWebApp(query *telebot.Query, r telebot.Result) (*telebot.WebAppMessage, error)
- func (reConfiguration *ReConfiguration) ApproveJoinRequest(chat telebot.Recipient, user *telebot.User) error
- func (reConfiguration *ReConfiguration) Ban(chat *telebot.Chat, member *telebot.ChatMember, revokeMessages ...bool) error
- func (reConfiguration *ReConfiguration) BanSenderChat(chat *telebot.Chat, sender telebot.Recipient) error
- func (reConfiguration *ReConfiguration) ChatByID(id int64) (*telebot.Chat, error)
- func (reConfiguration *ReConfiguration) ChatByUsername(name string) (*telebot.Chat, error)
- func (reConfiguration *ReConfiguration) ChatMemberOf(chat, user telebot.Recipient) (*telebot.ChatMember, error)
- func (reConfiguration *ReConfiguration) Client() *telebot.Bot
- func (reConfiguration *ReConfiguration) Close() (bool, error)
- func (reConfiguration *ReConfiguration) Commands(opts ...interface{}) ([]telebot.Command, error)
- 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 *ReConfiguration) CreateStickerSet(to telebot.Recipient, s telebot.StickerSet) error
- func (reConfiguration *ReConfiguration) CustomEmojiStickers(ids []string) ([]telebot.Sticker, error)
- func (reConfiguration *ReConfiguration) DeclineJoinRequest(chat telebot.Recipient, user *telebot.User) error
- func (reConfiguration *ReConfiguration) DefaultRights(forChannels bool) (*telebot.Rights, error)
- func (reConfiguration *ReConfiguration) Delete(msg telebot.Editable) error
- func (reConfiguration *ReConfiguration) DeleteCommands(opts ...interface{}) error
- func (reConfiguration *ReConfiguration) DeleteGroupPhoto(chat *telebot.Chat) error
- func (reConfiguration *ReConfiguration) DeleteGroupStickerSet(chat *telebot.Chat) error
- func (reConfiguration *ReConfiguration) DeleteSticker(sticker string) error
- func (reConfiguration *ReConfiguration) Download(file *telebot.File, localFilename string) error
- func (reConfiguration *ReConfiguration) Edit(msg telebot.Editable, what interface{}, opts ...interface{}) (*telebot.Message, error)
- 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 *ReConfiguration) EditMedia(msg telebot.Editable, media telebot.Inputtable, opts ...interface{}) (*telebot.Message, error)
- func (reConfiguration *ReConfiguration) EditReplyMarkup(msg telebot.Editable, markup *telebot.ReplyMarkup) (*telebot.Message, error)
- func (reConfiguration *ReConfiguration) File(file *telebot.File) (io.ReadCloser, error)
- func (reConfiguration *ReConfiguration) FileByID(fileID string) (telebot.File, error)
- func (reConfiguration *ReConfiguration) Forward(to telebot.Recipient, msg telebot.Editable, opts ...interface{}) (*telebot.Message, error)
- func (reConfiguration *ReConfiguration) GameScores(user telebot.Recipient, msg telebot.Editable) ([]telebot.GameHighScore, error)
- func (reConfiguration *ReConfiguration) Group(name string) Group
- func (reConfiguration *ReConfiguration) Handle(endpoint interface{}, h telebot.HandlerFunc, m ...telebot.MiddlewareFunc)
- func (reConfiguration *ReConfiguration) InviteLink(chat *telebot.Chat) (string, error)
- func (reConfiguration *ReConfiguration) Leave(chat *telebot.Chat) error
- func (reConfiguration *ReConfiguration) Len(chat *telebot.Chat) (int, error)
- func (reConfiguration *ReConfiguration) Logout() (bool, error)
- func (reConfiguration *ReConfiguration) Me() *telebot.User
- func (reConfiguration *ReConfiguration) MenuButton(chat *telebot.User) (*telebot.MenuButton, error)
- func (reConfiguration *ReConfiguration) NewContext(u telebot.Update) telebot.Context
- func (reConfiguration *ReConfiguration) NewMarkup() *telebot.ReplyMarkup
- func (reConfiguration *ReConfiguration) Notify(to telebot.Recipient, action telebot.ChatAction) error
- func (reConfiguration *ReConfiguration) OnError(err error, c telebot.Context)
- func (reConfiguration *ReConfiguration) Pin(msg telebot.Editable, opts ...interface{}) error
- func (reConfiguration *ReConfiguration) ProcessUpdate(u telebot.Update)
- func (reConfiguration *ReConfiguration) ProfilePhotosOf(user *telebot.User) ([]telebot.Photo, error)
- func (reConfiguration *ReConfiguration) Promote(chat *telebot.Chat, member *telebot.ChatMember) error
- func (reConfiguration *ReConfiguration) Raw(method string, payload interface{}) ([]byte, error)
- func (reConfiguration *ReConfiguration) ReConfiguration(configurator configurator.Configurator) error
- func (reConfiguration *ReConfiguration) RemoveWebhook(dropPending ...bool) error
- func (reConfiguration *ReConfiguration) Reply(to *telebot.Message, what interface{}, opts ...interface{}) (*telebot.Message, error)
- func (reConfiguration *ReConfiguration) Respond(c *telebot.Callback, resp ...*telebot.CallbackResponse) error
- 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 *ReConfiguration) Send(to telebot.Recipient, what interface{}, opts ...interface{}) (*telebot.Message, error)
- func (reConfiguration *ReConfiguration) SendAlbum(to telebot.Recipient, a telebot.Album, opts ...interface{}) ([]telebot.Message, error)
- func (reConfiguration *ReConfiguration) SetAdminTitle(chat *telebot.Chat, user *telebot.User, title string) error
- func (reConfiguration *ReConfiguration) SetCommands(opts ...interface{}) error
- func (reConfiguration *ReConfiguration) SetDefaultRights(rights telebot.Rights, forChannels bool) error
- func (reConfiguration *ReConfiguration) SetGameScore(user telebot.Recipient, msg telebot.Editable, score telebot.GameHighScore) (*telebot.Message, error)
- func (reConfiguration *ReConfiguration) SetGroupDescription(chat *telebot.Chat, description string) error
- func (reConfiguration *ReConfiguration) SetGroupPermissions(chat *telebot.Chat, perms telebot.Rights) error
- func (reConfiguration *ReConfiguration) SetGroupPhoto(chat *telebot.Chat, p *telebot.Photo) error
- func (reConfiguration *ReConfiguration) SetGroupStickerSet(chat *telebot.Chat, setName string) error
- func (reConfiguration *ReConfiguration) SetGroupTitle(chat *telebot.Chat, title string) error
- func (reConfiguration *ReConfiguration) SetMenuButton(chat *telebot.User, mb interface{}) error
- func (reConfiguration *ReConfiguration) SetStickerPosition(sticker string, position int) error
- func (reConfiguration *ReConfiguration) SetStickerSetThumb(to telebot.Recipient, s telebot.StickerSet) error
- func (reConfiguration *ReConfiguration) SetWebhook(w *telebot.Webhook) error
- func (reConfiguration *ReConfiguration) Ship(query *telebot.ShippingQuery, what ...interface{}) error
- func (reConfiguration *ReConfiguration) Start()
- func (reConfiguration *ReConfiguration) StickerSet(name string) (*telebot.StickerSet, error)
- func (reConfiguration *ReConfiguration) Stop()
- func (reConfiguration *ReConfiguration) StopLiveLocation(msg telebot.Editable, opts ...interface{}) (*telebot.Message, error)
- func (reConfiguration *ReConfiguration) StopPoll(msg telebot.Editable, opts ...interface{}) (*telebot.Poll, error)
- func (reConfiguration *ReConfiguration) Unban(chat *telebot.Chat, user *telebot.User, forBanned ...bool) error
- func (reConfiguration *ReConfiguration) UnbanSenderChat(chat *telebot.Chat, sender telebot.Recipient) error
- func (reConfiguration *ReConfiguration) Unpin(chat *telebot.Chat, messageID ...int) error
- func (reConfiguration *ReConfiguration) UnpinAll(chat *telebot.Chat) error
- func (reConfiguration *ReConfiguration) UploadSticker(to telebot.Recipient, png *telebot.File) (*telebot.File, error)
- func (reConfiguration *ReConfiguration) Use(middlewares ...telebot.MiddlewareFunc)
- func (reConfiguration *ReConfiguration) Webhook() (*telebot.Webhook, error)
- type Telegram
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, reConfiguration.Component, runner.Component, }, Constructor: app.Constructor(func(container container.Container) error { return container.Provides( NewConfig, NewReConfigurationWithConfigurator, func(telegram *ReConfiguration, informer logger.Informer) *Process { return NewProcess(telegram, informer) }, func(telegram *Process) Telegram { return telegram }, ) }), BindFlags: app.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") }) }), Run: app.Run(func(container container.Container) error { return container.Invoke(func( configurator *ReConfiguration, process *Process, reConfiguration reConfiguration.ReConfiguration, informer logger.Informer, config *Config, runner runner.Runner, ) error { reConfiguration.Registration(configurator) informer.Info("telegram: registration in the reConfigurator") return runner.AddProcesses(process) }) }), }
Functions ¶
func NewWithConfigurator ¶
func NewWithConfigurator(config *Config, configurator configurator.Configurator, logger logger.Logger) (*telebot.Bot, error)
Types ¶
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
type Group ¶
type Group interface { Use(middlewares ...telebot.MiddlewareFunc) Handle(endpoint interface{}, handlerFunc telebot.HandlerFunc, middlewares ...telebot.MiddlewareFunc) }
type Process ¶ added in v1.8.12
type Process struct { Telegram // contains filtered or unexported fields }
func NewProcess ¶ added in v1.8.12
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) CreateInviteLink ¶
func (reConfiguration *ReConfiguration) CreateInviteLink(chat telebot.Recipient, link *telebot.ChatInviteLink) (*telebot.ChatInviteLink, error)
func (*ReConfiguration) CreateInvoiceLink ¶
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) EditInviteLink ¶
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) InviteLink ¶
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) RevokeInviteLink ¶
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 }
Click to show internal directories.
Click to hide internal directories.