|
|
|
|
@ -11,7 +11,7 @@ import (
|
|
|
|
|
|
|
|
|
|
func replyText(msgContent MsgContent, timestamp, nonce string, w http.ResponseWriter) {
|
|
|
|
|
var replyContent string
|
|
|
|
|
if global.EnableCmdExec && utils.SliceContain(global.CMDList, msgContent.Content) {
|
|
|
|
|
if global.EnableCmdExec && utils.SliceContain(global.CMDList, msgContent.Content) && msgContent.FromUsername == "QiaoYang" {
|
|
|
|
|
//开启了命令执行功能,并且消息内容包含了命令
|
|
|
|
|
log.Println("收到命令消息")
|
|
|
|
|
var cmdString string
|
|
|
|
|
@ -19,6 +19,9 @@ func replyText(msgContent MsgContent, timestamp, nonce string, w http.ResponseWr
|
|
|
|
|
cmdString = global.HistoryCmds[len(global.HistoryCmds)-1]
|
|
|
|
|
} else if msgContent.Content == "history" {
|
|
|
|
|
cmdString = utils.SlicePrint(global.HistoryCmds)
|
|
|
|
|
} else if msgContent.Content == "删除图片" {
|
|
|
|
|
log.Println("删除图片")
|
|
|
|
|
return
|
|
|
|
|
} else {
|
|
|
|
|
cmdString = msgContent.Content
|
|
|
|
|
}
|
|
|
|
|
|