Update bot.md (#148)

Update to dispatcher.OnText(func(ctx *openwechat.MessageContext).
This commit is contained in:
blogbin 2022-12-10 21:51:15 +08:00 committed by GitHub
parent 25ba0a61f4
commit a7ca046e03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -171,7 +171,9 @@ bot.MessageHandler = func(msg *openwechat.Message) {
dispatcher := openwechat.NewMessageMatchDispatcher()
// 只处理消息类型为文本类型的消息
dispatcher.OnText(func(msg *Message){
dispatcher.OnText(func(ctx *openwechat.MessageContext){
msg := ctx.Message
fmt.Println("Text: ", msg.Content)
msg.ReplyText("hello")
})