chore(revive): make lint happy

This commit is contained in:
源文雨 2024-03-04 15:38:26 +09:00
parent 6c20f22548
commit ece68dae9b
6 changed files with 11 additions and 11 deletions

2
go.mod
View File

@ -24,7 +24,6 @@ require (
github.com/fumiama/go-base16384 v1.7.0
github.com/fumiama/go-registry v0.2.6
github.com/fumiama/gotracemoe v0.0.3
github.com/fumiama/imgsz v0.0.2
github.com/fumiama/jieba v0.0.0-20221203025406-36c17a10b565
github.com/fumiama/unibase2n v0.0.0-20221020155353-02876e777430
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
@ -57,6 +56,7 @@ require (
github.com/faiface/beep v1.1.0 // indirect
github.com/fumiama/go-simple-protobuf v0.1.0 // indirect
github.com/fumiama/gofastTEA v0.0.10 // indirect
github.com/fumiama/imgsz v0.0.2 // indirect
github.com/gabriel-vasile/mimetype v1.0.4 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect

View File

@ -75,7 +75,7 @@ func updateVup() error {
if err != nil {
return err
}
gjson.Get(binary.BytesToString(data), "@this").ForEach(func(key, value gjson.Result) bool {
gjson.Get(binary.BytesToString(data), "@this").ForEach(func(_, value gjson.Result) bool {
mid := value.Get("mid").Int()
uname := value.Get("uname").String()
roomid := value.Get("roomid").Int()

View File

@ -241,9 +241,9 @@ type listInfoOfAPI struct {
PublishTime int64 `json:"publishTime"`
Tns []string `json:"tns,omitempty"`
} `json:"tracks"`
VideoIds interface{} `json:"videoIds"`
VideoIDs interface{} `json:"videoIds"`
Videos interface{} `json:"videos"`
TrackIds []struct {
TrackIDs []struct {
ID int `json:"id"`
V int `json:"v"`
T int `json:"t"`

View File

@ -155,7 +155,7 @@ func (t *Timer) judgeHM() {
if t.SelfID != 0 {
t.sendmsg(t.GrpID, zero.GetBot(t.SelfID))
} else {
zero.RangeBot(func(id int64, ctx *zero.Ctx) (_ bool) {
zero.RangeBot(func(_ int64, ctx *zero.Ctx) (_ bool) {
t.sendmsg(t.GrpID, ctx)
return
})

View File

@ -57,14 +57,14 @@ func init() {
return
}
// 收集这波用户的streamId然后查当前的状态并建立信息映射表
streamIds := make([]string, len(infos))
streamIDs := make([]string, len(infos))
localPlayerMap := make(map[int64]*player)
for i := 0; i < len(infos); i++ {
streamIds[i] = strconv.FormatInt(infos[i].SteamID, 10)
streamIDs[i] = strconv.FormatInt(infos[i].SteamID, 10)
localPlayerMap[infos[i].SteamID] = infos[i]
}
// 将所有用户状态查一遍
playerStatus, err := getPlayerStatus(streamIds...)
playerStatus, err := getPlayerStatus(streamIDs...)
if err != nil {
// 出错就发消息
ctx.SendPrivateMessage(su, message.Text("[steam] ERROR: ", err))
@ -117,11 +117,11 @@ func init() {
}
// getPlayerStatus 获取用户状态
func getPlayerStatus(streamIds ...string) ([]*player, error) {
func getPlayerStatus(streamIDs ...string) ([]*player, error) {
players := make([]*player, 0)
// 拼接请求地址
apiKeyMu.Lock()
url := fmt.Sprintf(apiurl+statusurl, apiKey, strings.Join(streamIds, ","))
url := fmt.Sprintf(apiurl+statusurl, apiKey, strings.Join(streamIDs, ","))
apiKeyMu.Unlock()
// 拉取并解析数据
data, err := web.GetData(url)

View File

@ -178,7 +178,7 @@ func init() {
engine.OnMessage(canmatch(tKAWA), match(chatListK, seg)).
SetBlock(false).
Handle(randreply(sm.K))
engine.OnMessage(canmatch(tALPACA), func(ctx *zero.Ctx) bool {
engine.OnMessage(canmatch(tALPACA), func(_ *zero.Ctx) bool {
return alpacapiurl != "" && alpacatoken != ""
}).SetBlock(false).Handle(func(ctx *zero.Ctx) {
msg := ctx.ExtractPlainText()