Documentation
¶
Overview ¶
Package HaruiBot This package for make color log here. reference : https://shipengqi.github.io/posts/2019-09-18-go-color/
Index ¶
Constants ¶
View Source
const ( PanicLevel int = iota FatalLevel ErrorLevel WarnLevel InfoLevel DebugLevel )
Variables ¶
Functions ¶
func ProcessHandler ¶
func ProcessHandler()
Types ¶
type BotInstance ¶
type BotInstance struct {
UnionId int64 // union id is generated when an instance work here, to ensure instance worker can be found by id.
BotUserConfig BotConfig
BotRegisterUpdate []string
Worker tgbotapi.BotAPI
Self tgbotapi.User
}
BotInstance bot data will store into mapped runner.
func (*BotInstance) RunInstance ¶
func (b *BotInstance) RunInstance()
type BotRegister ¶
type BotRegister struct {
BotConfig
Token string
Debug bool
HttpClient http.Client // make request work with proxy if you are in Mainland China or some countries that you cannot contact.
OnUpdate []string // Telegram requests for updated information, which can ensure what bot will receive data here.
}
func (*BotRegister) GetInstance ¶
func (register *BotRegister) GetInstance() *BotInstance
GetInstance make a new instance bot here
type DefaultSets ¶
type DefaultSets struct {
DataFolder string
DisableChannelUser bool // in some situation,
// we may not want a channel (ignore / unknown user) to use our bot,
//so this function can enable to stop work for channel user yet.
DataBaseLocation string
}
DefaultSets when application work, read config here.
var ApplicationSets DefaultSets
Click to show internal directories.
Click to hide internal directories.