Skip to content

Commit

Permalink
chore: wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
EatHatsuneShallots committed Aug 8, 2024
1 parent 4cce0da commit 4f9b53d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions plugin/wallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import (
"os"
"strconv"
"time"
"strings"

"github.com/FloatTech/AnimeAPI/wallet"
"github.com/FloatTech/floatbox/binary"
"github.com/FloatTech/floatbox/file"
ctrl "github.com/FloatTech/zbpctrl"
"github.com/FloatTech/zbputils/control"
Expand Down Expand Up @@ -41,7 +43,7 @@ func init() {
if err != nil {
panic(err)
}
coinName = string(content)
coinName = binary.BytesToString(content)
} else {
// 旧版本数据
coinName = "ATRI币"
Expand Down Expand Up @@ -136,10 +138,10 @@ func init() {
}
ctx.SendChain(message.Image("file:///" + file.BOTPATH + "/" + drawedFile))
})
en.OnRegex(`^设置硬币名称\s*(.*)$`, zero.OnlyToMe, zero.SuperUserPermission).SetBlock(true).
en.OnPrefix("设置硬币名称", zero.OnlyToMe, zero.SuperUserPermission).SetBlock(true).
Handle(func(ctx *zero.Ctx) {
coinName := ctx.State["regex_matched"].([]string)[1]
err := os.WriteFile(coinNameFile, []byte(coinName), 0644)
coinName := strings.TrimSpace(ctx.State["args"].(string))
err := os.WriteFile(coinNameFile, binary.StringToBytes(coinName), 0644)
if err != nil {
ctx.SendChain(message.Text("ERROR: ", err))
return
Expand Down

0 comments on commit 4f9b53d

Please sign in to comment.