Quellcode durchsuchen

added voice command

master
Patrick Peng Sun vor 8 Jahren
Ursprung
Commit
0abb46b881
1 geänderte Dateien mit 17 neuen und 6 gelöschten Zeilen
  1. +17
    -6
      procEcho.go

+ 17
- 6
procEcho.go Datei anzeigen

@@ -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)
}

}


Laden…
Abbrechen
Speichern