Skip to content

Commit

Permalink
refactor: optimize details (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiajie99 authored Aug 13, 2023
1 parent c719cf0 commit 8162b32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions message_handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ func (m *MessageMatchDispatcher) OnGroupByGroupName(groupName string, handlers .
m.OnUser(f, handlers...)
}

// OnTrickled 注册处理消息类型为拍一拍的处理函数
func (m *MessageMatchDispatcher) OnTrickled(handlers ...MessageContextHandler) {
m.RegisterHandler(func(message *Message) bool { return message.IsTickled() }, handlers...)
}

// AsMessageHandler 将MessageMatchDispatcher转换为MessageHandler
func (m *MessageMatchDispatcher) AsMessageHandler() MessageHandler {
return func(msg *Message) {
Expand Down
2 changes: 1 addition & 1 deletion source/bot.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ bot.Login()

```go
// 创建热存储容器对象
reloadStorage := openwechat.NewJsonFileHotReloadStorage("storage.json")
reloadStorage := openwechat.NewFileHotReloadStorage("storage.json")

defer reloadStorage.Close()

Expand Down

0 comments on commit 8162b32

Please sign in to comment.