Documentation ¶
Index ¶
- type ChatID
- type GoTgBot
- func (g *GoTgBot) BanSenderChat(chat *telebot.Chat, sender telebot.Recipient) error
- func (g *GoTgBot) CheckSign(ts int64, sign string) bool
- func (g *GoTgBot) CreateMiddleware(...) telebot.MiddlewareFunc
- func (g *GoTgBot) CreateMyAccountCommand(commandText string)
- func (g *GoTgBot) CreateWebAppStartCommand(menuButtonText string)
- func (g *GoTgBot) GetBot() *telebot.Bot
- func (g *GoTgBot) GetConfig() *TelegramBot
- func (g *GoTgBot) Handle(endpoint interface{}, h telebot.HandlerFunc, m ...telebot.MiddlewareFunc)
- func (g *GoTgBot) ReplyMarkup() *telebot.ReplyMarkup
- func (g *GoTgBot) Send(to telebot.Recipient, what interface{}, opts ...interface{}) (*telebot.Message, error)
- func (g *GoTgBot) SendAlbum(to telebot.Recipient, a telebot.Album, opts ...interface{}) ([]telebot.Message, error)
- func (g *GoTgBot) SendFromDiskAudios(to telebot.Recipient, fromDiskFiles []string) ([]telebot.Message, error)
- func (g *GoTgBot) SendFromDiskPhotos(to telebot.Recipient, fromDiskFiles []string) ([]telebot.Message, error)
- func (g *GoTgBot) SendFromDiskVideos(to telebot.Recipient, fromDiskFiles []string) ([]telebot.Message, error)
- func (g *GoTgBot) SendFromUrlAudios(to telebot.Recipient, urls []string) ([]telebot.Message, error)
- func (g *GoTgBot) SendFromUrlPhotos(to telebot.Recipient, urls []string) ([]telebot.Message, error)
- func (g *GoTgBot) SendFromUrlVideos(to telebot.Recipient, urls []string) ([]telebot.Message, error)
- func (g *GoTgBot) SendMsgText(chatId int64, msg string, opts ...interface{}) (*telebot.Message, error)
- func (g *GoTgBot) StartBot()
- func (g *GoTgBot) StopBot()
- func (g *GoTgBot) Use(middleware ...telebot.MiddlewareFunc)
- func (g *GoTgBot) UseMiddleware(...)
- type GoTgBots
- type TelegramBot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoTgBot ¶
type GoTgBot struct {
// contains filtered or unexported fields
}
func CreateOfflineBot ¶
func CreateOfflineBot(config *TelegramBot) (*GoTgBot, error)
离线测试, 模拟用户发命令
b.ProcessUpdate(tele.Update{ Message: &tele.Message{Text: "/a"}, })
func (*GoTgBot) BanSenderChat ¶
func (*GoTgBot) CreateMiddleware ¶
func (*GoTgBot) CreateMyAccountCommand ¶ added in v1.2.14
func (*GoTgBot) CreateWebAppStartCommand ¶ added in v1.2.14
/start
func (*GoTgBot) GetConfig ¶
func (g *GoTgBot) GetConfig() *TelegramBot
func (*GoTgBot) Handle ¶
func (g *GoTgBot) Handle(endpoint interface{}, h telebot.HandlerFunc, m ...telebot.MiddlewareFunc)
func (*GoTgBot) ReplyMarkup ¶
func (g *GoTgBot) ReplyMarkup() *telebot.ReplyMarkup
func (*GoTgBot) SendFromDiskAudios ¶
func (*GoTgBot) SendFromDiskPhotos ¶
func (*GoTgBot) SendFromDiskVideos ¶
func (*GoTgBot) SendFromUrlAudios ¶
func (*GoTgBot) SendFromUrlPhotos ¶
func (*GoTgBot) SendFromUrlVideos ¶
func (*GoTgBot) SendMsgText ¶
type GoTgBots ¶
type GoTgBots struct {
// contains filtered or unexported fields
}
func (*GoTgBots) CreateBot ¶
func (g *GoTgBots) CreateBot(config *TelegramBot) (*GoTgBot, error)
同一个产品只会存在一个,后一个添加的覆盖前面添加
func (*GoTgBots) DestroyBot ¶
type TelegramBot ¶
type TelegramBot struct { Product string `yaml:"Product" json:"product"` ApiUrl string `yaml:"ApiUrl" json:"apiUrl,optional"` ParseMode telebot.ParseMode `yaml:"ParseMode" json:"parseMode,optional"` Token string `yaml:"Token" json:"token"` Timeout int64 `yaml:"Timeout" json:"timeout,optional"` //s tg bot api timeout Offline bool `yaml:"Offline" json:"offline,optional"` Synchronous bool `yaml:"Synchronous" json:"synchronous,optional"` // Product configuration (可选) Open bool `yaml:"Open" json:"open,optional"` //是否开启 WebAppUrl string `yaml:"WebAppUrl" json:"webAppUrl,optional"` StartReply string `yaml:"StartReply" json:"startReply,optional"` SignSecret string `yaml:"SignSecret" json:"signSecret,optional"` //请求签名密钥 SignTimeout int64 `yaml:"SignTimeout" json:"signTimeout,optional"` //请求签名过期时间-秒 AccessSecret string `yaml:"AccessSecret" json:"accessSecret,optional"` //jwt signature secret AccessExpire int64 `yaml:"AccessExpire" json:"accessExpire,optional"` // jwt signature accessExpire }
Click to show internal directories.
Click to hide internal directories.