删除一些冗余的函数 (#179)

This commit is contained in:
多吃点苹果 2023-01-06 00:59:35 +08:00 committed by GitHub
parent fc438ab83f
commit 00e99ed293
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

25
bot.go
View File

@ -277,16 +277,6 @@ func (b *Bot) CrashReason() error {
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
func (b *Bot) DumpHotReloadStorage() error {
if b.hotReloadStorage == nil {
@ -309,21 +299,6 @@ func (b *Bot) DumpTo(writer io.Writer) error {
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的构造方法
// 接收外部的 context.Context用于控制Bot的存活
func NewBot(c context.Context) *Bot {