Parcourir la source

added voice command

master
Patrick Peng Sun il y a 8 ans
Parent
révision
0abb46b881
1 fichiers modifiés avec 17 ajouts et 6 suppressions
  1. +17
    -6
      procEcho.go

+ 17
- 6
procEcho.go Voir le fichier

@@ -33,16 +33,27 @@ func echoStart(ss *openIDSessionData, in InWechatMsg) {
}

func echoServe(ss *openIDSessionData, in InWechatMsg) {
stopEcho := false
if in.header.MsgType == "text" {
if in.body.(TextMsg).Content == "结束Echo" {
in.replyText("echo 正式结束")
echoSummary(ss)
echoClean(ss)
if in.body.(TextMsg).Content == "结束Echo" || in.body.(TextMsg).Content == "结束echo" {
stopEcho = true
return
}
}
ss.refreshExpire(600)
echoCommand(ss, in)
if in.header.MsgType == "voice" {
if in.body.(VoiceMsg).Recognition == "退出退出。" {
stopEcho = true
}
}

if stopEcho {
in.replyText("echo 正式结束")
echoSummary(ss)
echoClean(ss)
} else {
ss.refreshExpire(600)
echoCommand(ss, in)
}

}


Chargement…
Annuler
Enregistrer