Kaynağa Gözat

added voice command

master
Patrick Peng Sun 8 yıl önce
ebeveyn
işleme
0abb46b881
1 değiştirilmiş dosya ile 17 ekleme ve 6 silme
  1. +17
    -6
      procEcho.go

+ 17
- 6
procEcho.go Dosyayı Görüntüle

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

}


Yükleniyor…
İptal
Kaydet