Skip to content

Commit 21988fa

Browse files
committed
⬆️ update to go 1.18
1 parent 2c545e7 commit 21988fa

File tree

7 files changed

+25
-87
lines changed

7 files changed

+25
-87
lines changed

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Setup Go environment
2929
uses: actions/[email protected]
3030
with:
31-
go-version: 1.17
31+
go-version: 1.18
3232
- name: Cache downloaded module
3333
uses: actions/cache@v2
3434
with:

.github/workflows/pull.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
- name: Set up Go
99
uses: actions/setup-go@v2
1010
with:
11-
go-version: 1.17
11+
go-version: 1.18
1212

1313
- name: Check out code into the Go module directory
1414
uses: actions/checkout@v2

.github/workflows/push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
- name: Set up Go
99
uses: actions/setup-go@v2
1010
with:
11-
go-version: 1.17
11+
go-version: 1.18
1212

1313
- name: Check out code into the Go module directory
1414
uses: actions/checkout@v2

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Go
1717
uses: actions/setup-go@v2
1818
with:
19-
go-version: '1.17'
19+
go-version: '1.18'
2020

2121
- name: Run GoReleaser
2222
uses: goreleaser/goreleaser-action@v2

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
module github.com/FloatTech/ZeroBot-Plugin
22

3-
go 1.17
3+
go 1.18
44

55
require (
6-
github.com/FloatTech/AnimeAPI v1.3.2-0.20220315144908-33d5c403d240
6+
github.com/FloatTech/AnimeAPI v1.3.2-0.20220319114940-c6c7d308c43b
77
github.com/FloatTech/sqlite v0.2.1
8-
github.com/FloatTech/zbputils v1.3.2-0.20220318084913-05364a3da744
8+
github.com/FloatTech/zbputils v1.3.2-0.20220319114731-e5088958ce00
99
github.com/antchfx/htmlquery v1.2.4
1010
github.com/corona10/goimagehash v1.0.3
1111
github.com/fogleman/gg v1.3.0
1212
github.com/fumiama/cron v1.3.0
13-
github.com/fumiama/go-base16384 v1.3.1
13+
github.com/fumiama/go-base16384 v1.4.0
1414
github.com/fumiama/go-registry v0.1.1
1515
github.com/fumiama/gofastTEA v0.0.10
1616
github.com/fumiama/gotracemoe v0.0.3

go.sum

Lines changed: 10 additions & 72 deletions
Large diffs are not rendered by default.

plugin/b14/main.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ func init() {
2323
en.OnRegex(`^加密\s?(.*)`).SetBlock(true).
2424
Handle(func(ctx *zero.Ctx) {
2525
str := ctx.State["regex_matched"].([]string)[1]
26-
es, err := base14.UTF16be2utf8(base14.EncodeString(str))
27-
if err == nil {
28-
ctx.SendChain(message.Text(helper.BytesToString(es)))
26+
es := base14.EncodeString(str)
27+
if es != "" {
28+
ctx.SendChain(message.Text(es))
2929
} else {
3030
ctx.SendChain(message.Text("加密失败!"))
3131
}
3232
})
3333
en.OnRegex(`^解密\s?([一-踀]*[㴁-㴆]?)$`).SetBlock(true).
3434
Handle(func(ctx *zero.Ctx) {
3535
str := ctx.State["regex_matched"].([]string)[1]
36-
es, err := base14.UTF82utf16be(helper.StringToBytes(str))
37-
if err == nil {
36+
es := base14.DecodeString(str)
37+
if es != "" {
3838
ctx.SendChain(message.Text(base14.DecodeString(es)))
3939
} else {
4040
ctx.SendChain(message.Text("解密失败!"))
@@ -44,7 +44,7 @@ func init() {
4444
Handle(func(ctx *zero.Ctx) {
4545
key, str := ctx.State["regex_matched"].([]string)[1], ctx.State["regex_matched"].([]string)[2]
4646
t := getea(key)
47-
es, err := base14.UTF16be2utf8(base14.Encode(t.Encrypt(helper.StringToBytes(str))))
47+
es, err := base14.UTF16BE2UTF8(base14.Encode(t.Encrypt(helper.StringToBytes(str))))
4848
if err == nil {
4949
ctx.SendChain(message.Text(helper.BytesToString(es)))
5050
} else {
@@ -55,7 +55,7 @@ func init() {
5555
Handle(func(ctx *zero.Ctx) {
5656
key, str := ctx.State["regex_matched"].([]string)[1], ctx.State["regex_matched"].([]string)[2]
5757
t := getea(key)
58-
es, err := base14.UTF82utf16be(helper.StringToBytes(str))
58+
es, err := base14.UTF82UTF16BE(helper.StringToBytes(str))
5959
if err == nil {
6060
ctx.SendChain(message.Text(helper.BytesToString(t.Decrypt(base14.Decode(es)))))
6161
} else {

0 commit comments

Comments
 (0)