mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-12 02:00:24 +00:00
make lint happy
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
_ "github.com/logoove/sqlite"
|
||||
_ "github.com/logoove/sqlite" // use sql
|
||||
"github.com/sirupsen/logrus"
|
||||
zero "github.com/wdvxdr1123/ZeroBot"
|
||||
"github.com/wdvxdr1123/ZeroBot/message"
|
||||
@@ -106,22 +106,22 @@ func init() {
|
||||
} else {
|
||||
tc := db.GetThirdCategory(firstIndex, secondIndex, thirdIndex)
|
||||
reg := regexp.MustCompile(regStr)
|
||||
recordUrl := tc.ThirdCategoryPath
|
||||
if recordUrl == "" {
|
||||
recURL := tc.ThirdCategoryPath
|
||||
if recURL == "" {
|
||||
ctx.SendChain(message.Reply(e.MessageID), message.Text("没有内容请重新选择,三次输入错误,指令可退出重输"))
|
||||
ctx.SendChain(message.Reply(e.MessageID), message.Text(db.GetAllFirstCategoryMessage()))
|
||||
errorCount++
|
||||
step = 1
|
||||
} else {
|
||||
if reg.MatchString(recordUrl) {
|
||||
if reg.MatchString(recURL) {
|
||||
// log.Println(reg.FindStringSubmatch(recordUrl)[1])
|
||||
// log.Println(url.QueryEscape(reg.FindStringSubmatch(recordUrl)[1]))
|
||||
recordUrl = strings.ReplaceAll(recordUrl, reg.FindStringSubmatch(recordUrl)[1], url.QueryEscape(reg.FindStringSubmatch(recordUrl)[1]))
|
||||
recordUrl = strings.ReplaceAll(recordUrl, "+", "%20")
|
||||
recURL = strings.ReplaceAll(recURL, reg.FindStringSubmatch(recURL)[1], url.QueryEscape(reg.FindStringSubmatch(recURL)[1]))
|
||||
recURL = strings.ReplaceAll(recURL, "+", "%20")
|
||||
// log.Println(recordUrl)
|
||||
}
|
||||
ctx.SendChain(message.Reply(e.MessageID), message.Text("请欣赏《"+tc.ThirdCategoryName+"》"))
|
||||
ctx.SendChain(message.Record(recordUrl))
|
||||
ctx.SendChain(message.Record(recURL))
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -145,16 +145,16 @@ func init() {
|
||||
fc := db.GetFirstCategoryByFirstUid(tc.FirstCategoryUid)
|
||||
if (tc != model.ThirdCategory{}) && (fc != model.FirstCategory{}) {
|
||||
reg := regexp.MustCompile(regStr)
|
||||
recordUrl := tc.ThirdCategoryPath
|
||||
if reg.MatchString(recordUrl) {
|
||||
recURL := tc.ThirdCategoryPath
|
||||
if reg.MatchString(recURL) {
|
||||
// log.Println(reg.FindStringSubmatch(recordUrl)[1])
|
||||
// log.Println(url.QueryEscape(reg.FindStringSubmatch(recordUrl)[1]))
|
||||
recordUrl = strings.ReplaceAll(recordUrl, reg.FindStringSubmatch(recordUrl)[1], url.QueryEscape(reg.FindStringSubmatch(recordUrl)[1]))
|
||||
recordUrl = strings.ReplaceAll(recordUrl, "+", "%20")
|
||||
recURL = strings.ReplaceAll(recURL, reg.FindStringSubmatch(recURL)[1], url.QueryEscape(reg.FindStringSubmatch(recURL)[1]))
|
||||
recURL = strings.ReplaceAll(recURL, "+", "%20")
|
||||
// log.Println(recordUrl)
|
||||
}
|
||||
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text("请欣赏"+fc.FirstCategoryName+"的《"+tc.ThirdCategoryName+"》"))
|
||||
ctx.SendChain(message.Record(recordUrl))
|
||||
ctx.SendChain(message.Record(recURL))
|
||||
}
|
||||
db.Close()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user