Update bot.md (#148)
Update to dispatcher.OnText(func(ctx *openwechat.MessageContext).
This commit is contained in:
parent
25ba0a61f4
commit
a7ca046e03
@ -171,7 +171,9 @@ bot.MessageHandler = func(msg *openwechat.Message) {
|
|||||||
dispatcher := openwechat.NewMessageMatchDispatcher()
|
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")
|
msg.ReplyText("hello")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user