update
This commit is contained in:
@@ -42,4 +42,9 @@ func init() {
|
|||||||
initSys()
|
initSys()
|
||||||
Duration = time.Duration(sillyGirl.GetInt("duration", 5)) * time.Second
|
Duration = time.Duration(sillyGirl.GetInt("duration", 5)) * time.Second
|
||||||
sillyGirl.Set("started_at", time.Now().Format("2006-01-02 15:04:05"))
|
sillyGirl.Set("started_at", time.Now().Format("2006-01-02 15:04:05"))
|
||||||
|
api_key := sillyGirl.Get("api_key")
|
||||||
|
if api_key == "" {
|
||||||
|
api_key := time.Now().UnixNano()
|
||||||
|
sillyGirl.Set("api_key", api_key)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-5
@@ -9,6 +9,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
"sync"
|
||||||
|
|
||||||
"github.com/axgle/mahonia"
|
"github.com/axgle/mahonia"
|
||||||
"github.com/beego/beego/v2/adapter/httplib"
|
"github.com/beego/beego/v2/adapter/httplib"
|
||||||
@@ -169,6 +170,8 @@ func init() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var wxbase sync.Map
|
||||||
|
|
||||||
var myip = ""
|
var myip = ""
|
||||||
var relaier = wx.Get("relaier")
|
var relaier = wx.Get("relaier")
|
||||||
|
|
||||||
@@ -259,12 +262,14 @@ func (sender *Sender) Reply(msgs ...interface{}) (int, error) {
|
|||||||
switch item.(type) {
|
switch item.(type) {
|
||||||
case string:
|
case string:
|
||||||
pmsg.Msg = item.(string)
|
pmsg.Msg = item.(string)
|
||||||
// images := []string{}
|
images := []string{}
|
||||||
// for _, v := range regexp.MustCompile(`\[CQ:image,file=base64://([^\[\]]+)\]`).FindAllStringSubmatch(pmsg.Msg, -1) {
|
for _, v := range regexp.MustCompile(`\[CQ:image,file=base64://([^\[\]]+)\]`).FindAllStringSubmatch(pmsg.Msg, -1) {
|
||||||
// images = append(images, v[1])
|
images = append(images, v[1])
|
||||||
// message = strings.Replace(message, fmt.Sprintf(`[CQ:image,file=base64://%s]`, v[1]), "", -1)
|
pmsg.Msg = strings.Replace(pmsg.Msg, fmt.Sprintf(`[CQ:image,file=base64://%s]`, v[1]), "", -1)
|
||||||
|
}
|
||||||
|
// for _, image := range images {
|
||||||
|
// wxbase
|
||||||
// }
|
// }
|
||||||
// if
|
|
||||||
case []byte:
|
case []byte:
|
||||||
pmsg.Msg = string(item.([]byte))
|
pmsg.Msg = string(item.([]byte))
|
||||||
case core.ImageUrl:
|
case core.ImageUrl:
|
||||||
|
|||||||
Reference in New Issue
Block a user