Skip to content

Commit

Permalink
删除一些冗余的函数 (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
eatmoreapple authored Jan 5, 2023
1 parent fc438ab commit 00e99ed
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 00e99ed

Please sign in to comment.