删除一些冗余的函数 (#179)
This commit is contained in:
parent
fc438ab83f
commit
00e99ed293
25
bot.go
25
bot.go
@ -277,16 +277,6 @@ func (b *Bot) CrashReason() error {
|
|||||||
return b.err
|
return b.err
|
||||||
}
|
}
|
||||||
|
|
||||||
// MessageOnSuccess setter for Bot.MessageHandler
|
|
||||||
func (b *Bot) MessageOnSuccess(h func(msg *Message)) {
|
|
||||||
b.MessageHandler = h
|
|
||||||
}
|
|
||||||
|
|
||||||
// MessageOnError setter for bot.GetMessageErrorHandler
|
|
||||||
func (b *Bot) MessageOnError(h func(err error) bool) {
|
|
||||||
b.MessageErrorHandler = h
|
|
||||||
}
|
|
||||||
|
|
||||||
// DumpHotReloadStorage 写入HotReloadStorage
|
// DumpHotReloadStorage 写入HotReloadStorage
|
||||||
func (b *Bot) DumpHotReloadStorage() error {
|
func (b *Bot) DumpHotReloadStorage() error {
|
||||||
if b.hotReloadStorage == nil {
|
if b.hotReloadStorage == nil {
|
||||||
@ -309,21 +299,6 @@ func (b *Bot) DumpTo(writer io.Writer) error {
|
|||||||
return json.NewEncoder(writer).Encode(item)
|
return json.NewEncoder(writer).Encode(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
// OnLogin is a setter for LoginCallBack
|
|
||||||
func (b *Bot) OnLogin(f func(body []byte)) {
|
|
||||||
b.LoginCallBack = f
|
|
||||||
}
|
|
||||||
|
|
||||||
// OnScanned is a setter for ScanCallBack
|
|
||||||
func (b *Bot) OnScanned(f func(body []byte)) {
|
|
||||||
b.ScanCallBack = f
|
|
||||||
}
|
|
||||||
|
|
||||||
// OnLogout is a setter for LogoutCallBack
|
|
||||||
func (b *Bot) OnLogout(f func(bot *Bot)) {
|
|
||||||
b.LogoutCallBack = f
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewBot Bot的构造方法
|
// NewBot Bot的构造方法
|
||||||
// 接收外部的 context.Context,用于控制Bot的存活
|
// 接收外部的 context.Context,用于控制Bot的存活
|
||||||
func NewBot(c context.Context) *Bot {
|
func NewBot(c context.Context) *Bot {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user