Skip to content

Commit a029add

Browse files
authored
权重查询美化 (#560)
1 parent 778b874 commit a029add

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

plugin/quan/quan.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package quan
44
import (
55
"fmt"
66
"strconv"
7+
"strings"
78

89
"github.com/FloatTech/floatbox/web"
910
ctrl "github.com/FloatTech/zbpctrl"
@@ -35,6 +36,23 @@ func init() { // 主函数
3536
ctx.SendChain(message.Text("出现错误捏:", err))
3637
return
3738
}
38-
ctx.SendChain(message.Text(str, helper.BytesToString(es))) // 输出结果
39+
if len(helper.BytesToString(es)) <= 24 {
40+
ctx.SendChain(message.Text("网站维护中")) // 输出结果
41+
return
42+
}
43+
f := helper.BytesToString(es)[24:]
44+
_, err = strconv.Atoi(f)
45+
if err != nil {
46+
ctx.SendChain(message.Text("网站维护中")) // 输出结果
47+
return
48+
}
49+
var msg strings.Builder
50+
msg.WriteString("查询账号:")
51+
msg.WriteString(str)
52+
msg.WriteString("\n")
53+
msg.WriteString("查询状态:成功\n")
54+
msg.WriteString("您的权重为:")
55+
msg.WriteString(f)
56+
ctx.SendChain(message.Text(msg.String())) // 输出结果
3957
})
4058
}

0 commit comments

Comments
 (0)