Skip to content

Commit

Permalink
fix: gsvits
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Aug 27, 2023
1 parent 9dade7f commit 30f60bc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 20 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.20

require (
github.com/Baidu-AIP/golang-sdk v1.1.1
github.com/FloatTech/AnimeAPI v1.6.1-0.20230827144904-758793598579
github.com/FloatTech/AnimeAPI v1.6.1-0.20230827161910-7e6a3d93a0ba
github.com/FloatTech/floatbox v0.0.0-20230827160415-f0865337a824
github.com/FloatTech/gg v1.1.3-0.20230226151425-6ea91286ba08
github.com/FloatTech/imgfactory v0.2.2-0.20230413152719-e101cc3606ef
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ github.com/Baidu-AIP/golang-sdk v1.1.1 h1:RQsAmgDSAkiq22I6n7XJ2t3afgzFeqjY46FGhv
github.com/Baidu-AIP/golang-sdk v1.1.1/go.mod h1:bXnGw7xPeKt8aF7UCELKrV6UZ/46spItONK1RQBQj1Y=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/FloatTech/AnimeAPI v1.6.1-0.20230827144904-758793598579 h1:IMbVe2zNXAgoNaSnNzXq9F3PSgf6tbqbDUjzBwmCOkA=
github.com/FloatTech/AnimeAPI v1.6.1-0.20230827144904-758793598579/go.mod h1:6vYu7bW5gPQsBnXB+I6yk+eJQaaAwusoQ/I/wQMwOAI=
github.com/FloatTech/AnimeAPI v1.6.1-0.20230827161910-7e6a3d93a0ba h1:0tqYkIc6RK8P3/cGEMSoBBwhiEHKPJC+1F7xlVkikgY=
github.com/FloatTech/AnimeAPI v1.6.1-0.20230827161910-7e6a3d93a0ba/go.mod h1:6vYu7bW5gPQsBnXB+I6yk+eJQaaAwusoQ/I/wQMwOAI=
github.com/FloatTech/floatbox v0.0.0-20230827160415-f0865337a824 h1:w72fzQg1Y9+VLSRl7iKzaZ6fG3myyMJfpOSajcjaMDM=
github.com/FloatTech/floatbox v0.0.0-20230827160415-f0865337a824/go.mod h1:FwQm6wk+b4wuW54KCKn3zccMX47Q5apnHD/Yakzv0fI=
github.com/FloatTech/gg v1.1.3-0.20230226151425-6ea91286ba08 h1:dPLeoiTVSBlgls+66EB/UJ2e38BaASmBN5nANaycSBU=
Expand Down
16 changes: 0 additions & 16 deletions plugin/ai_reply/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@
package aireply

import (
"crypto/md5"
"encoding/hex"
"os"
"regexp"
"strconv"
"strings"
"time"

"github.com/FloatTech/AnimeAPI/tts/genshin"
"github.com/FloatTech/floatbox/binary"
"github.com/FloatTech/floatbox/file"
ctrl "github.com/FloatTech/zbpctrl"
"github.com/FloatTech/zbputils/control"
"github.com/FloatTech/zbputils/ctxext"
Expand Down Expand Up @@ -110,17 +105,6 @@ func init() { // 插件主体
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text(reply))
return
}
if strings.HasPrefix(rec, "http") {
b := md5.Sum(binary.StringToBytes(rec))
fn := hex.EncodeToString(b[:])
fp := ttscachedir + fn
if file.IsNotExist(fp) {
if file.DownloadTo(rec, fp) != nil {
return
}
}
rec = "file:///" + file.BOTPATH + "/" + fp
}
// 发送语音
if id := ctx.SendChain(message.Record(rec)); id.ID() == 0 {
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text(reply))
Expand Down
2 changes: 1 addition & 1 deletion plugin/moegoe/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func init() {
}
text := ctx.State["regex_matched"].([]string)[2]
name := ctx.State["regex_matched"].([]string)[1]
rec := fmt.Sprintf(genshin.CNAPI, name, url.QueryEscape(text), url.QueryEscape(.k))
rec := fmt.Sprintf(genshin.CNAPI, url.QueryEscape(name), url.QueryEscape(text), url.QueryEscape(.k))
b := md5.Sum(binary.StringToBytes(rec))
fn := hex.EncodeToString(b[:])
fp := "data/tts/" + fn
Expand Down

0 comments on commit 30f60bc

Please sign in to comment.