添加消息处理
This commit is contained in:
8
main.go
8
main.go
@@ -2,17 +2,19 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"go-bot/bot/controller"
|
||||
|
||||
"github.com/eatmoreapple/openwechat"
|
||||
)
|
||||
|
||||
func main() {
|
||||
bot := openwechat.DefaultBot(openwechat.Desktop)
|
||||
// bot := openwechat.DefaultBot(openwechat.Desktop) // 桌面模式,上面登录不上的可以尝试切换这种模式
|
||||
|
||||
// 注册消息处理函数
|
||||
bot.MessageHandler = func(msg *openwechat.Message) {
|
||||
if msg.IsText() && msg.Content == "ping" {
|
||||
msg.ReplyText("pong")
|
||||
if msg.IsText() && msg.Content == "专升本英语选择题" {
|
||||
controller.SingleChoice(msg)
|
||||
}
|
||||
}
|
||||
// 注册登陆二维码回调
|
||||
|
||||
Reference in New Issue
Block a user