mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-12 02:00:24 +00:00
chore(revive): make lint happy
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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"`
|
||||
|
||||
@@ -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
|
||||
})
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user