mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 22:00:11 +08:00
🎨 改进代码样式
This commit is contained in:
parent
e812d2a074
commit
d6f1113201
@ -1,12 +1,13 @@
|
|||||||
package plugin_vtb_quotation
|
package plugin_vtb_quotation
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/FloatTech/ZeroBot-Plugin/plugin_vtb_quotation/firstVtb"
|
|
||||||
"github.com/FloatTech/ZeroBot-Plugin/plugin_vtb_quotation/model"
|
|
||||||
"github.com/FloatTech/ZeroBot-Plugin/plugin_vtb_quotation/secondVtb"
|
|
||||||
"github.com/fumiama/cron"
|
"github.com/fumiama/cron"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
zero "github.com/wdvxdr1123/ZeroBot"
|
zero "github.com/wdvxdr1123/ZeroBot"
|
||||||
|
|
||||||
|
"github.com/FloatTech/ZeroBot-Plugin/plugin_vtb_quotation/firstVtb"
|
||||||
|
"github.com/FloatTech/ZeroBot-Plugin/plugin_vtb_quotation/model"
|
||||||
|
"github.com/FloatTech/ZeroBot-Plugin/plugin_vtb_quotation/secondVtb"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@ -1,15 +1,17 @@
|
|||||||
package firstVtb
|
package firstVtb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/FloatTech/ZeroBot-Plugin/plugin_vtb_quotation/model"
|
|
||||||
"github.com/FloatTech/ZeroBot-Plugin/plugin_vtb_quotation/utils"
|
|
||||||
"github.com/jinzhu/gorm"
|
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
"github.com/tidwall/gjson"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/jinzhu/gorm"
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
|
"github.com/tidwall/gjson"
|
||||||
|
|
||||||
|
"github.com/FloatTech/ZeroBot-Plugin/plugin_vtb_quotation/model"
|
||||||
|
"github.com/FloatTech/ZeroBot-Plugin/plugin_vtb_quotation/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
var vtbUrl = "https://vtbkeyboard.moe/api/get_vtb_list"
|
var vtbUrl = "https://vtbkeyboard.moe/api/get_vtb_list"
|
||||||
@ -70,7 +72,6 @@ func DealVtbListStr(vtbListStr string) []string {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
uidList = append(uidList, fc.FirstCategoryUid)
|
uidList = append(uidList, fc.FirstCategoryUid)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Println(uidList)
|
log.Println(uidList)
|
||||||
|
|||||||
@ -1,15 +1,17 @@
|
|||||||
package secondVtb
|
package secondVtb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/FloatTech/ZeroBot-Plugin/plugin_vtb_quotation/model"
|
|
||||||
"github.com/FloatTech/ZeroBot-Plugin/plugin_vtb_quotation/utils"
|
|
||||||
"github.com/jinzhu/gorm"
|
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
"github.com/tidwall/gjson"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/jinzhu/gorm"
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
|
"github.com/tidwall/gjson"
|
||||||
|
|
||||||
|
"github.com/FloatTech/ZeroBot-Plugin/plugin_vtb_quotation/model"
|
||||||
|
"github.com/FloatTech/ZeroBot-Plugin/plugin_vtb_quotation/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetVtbStr(uid string) string {
|
func GetVtbStr(uid string) string {
|
||||||
@ -38,7 +40,6 @@ func GetVtbStr(uid string) string {
|
|||||||
}
|
}
|
||||||
log.Println(vtbListStr)
|
log.Println(vtbListStr)
|
||||||
return vtbListStr
|
return vtbListStr
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func DealVtbStr(vtbStr, uid string) {
|
func DealVtbStr(vtbStr, uid string) {
|
||||||
@ -104,5 +105,4 @@ func DealVtbStr(vtbStr, uid string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,18 +2,20 @@ package plugin_vtb_quotation
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/FloatTech/ZeroBot-Plugin/control"
|
|
||||||
"github.com/FloatTech/ZeroBot-Plugin/plugin_vtb_quotation/model"
|
|
||||||
"github.com/jinzhu/gorm"
|
|
||||||
_ "github.com/logoove/sqlite"
|
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
zero "github.com/wdvxdr1123/ZeroBot"
|
|
||||||
"github.com/wdvxdr1123/ZeroBot/message"
|
|
||||||
"net/url"
|
"net/url"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/jinzhu/gorm"
|
||||||
|
_ "github.com/logoove/sqlite"
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
|
zero "github.com/wdvxdr1123/ZeroBot"
|
||||||
|
"github.com/wdvxdr1123/ZeroBot/message"
|
||||||
|
|
||||||
|
"github.com/FloatTech/ZeroBot-Plugin/control"
|
||||||
|
"github.com/FloatTech/ZeroBot-Plugin/plugin_vtb_quotation/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -73,7 +75,6 @@ func init() {
|
|||||||
ctx.SendChain(message.Reply(e.MessageID), message.Text(SecondStepMessage))
|
ctx.SendChain(message.Reply(e.MessageID), message.Text(SecondStepMessage))
|
||||||
step++
|
step++
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} else if step == 2 {
|
} else if step == 2 {
|
||||||
secondIndex, err = strconv.Atoi(e.RawMessage)
|
secondIndex, err = strconv.Atoi(e.RawMessage)
|
||||||
@ -93,7 +94,6 @@ func init() {
|
|||||||
ctx.SendChain(message.Reply(e.MessageID), message.Text(ThirdStepMessage))
|
ctx.SendChain(message.Reply(e.MessageID), message.Text(ThirdStepMessage))
|
||||||
step++
|
step++
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} else if step == 3 {
|
} else if step == 3 {
|
||||||
thirdIndex, err = strconv.Atoi(e.RawMessage)
|
thirdIndex, err = strconv.Atoi(e.RawMessage)
|
||||||
@ -124,7 +124,6 @@ func init() {
|
|||||||
cancel()
|
cancel()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case <-time.After(time.Second * 60):
|
case <-time.After(time.Second * 60):
|
||||||
@ -156,6 +155,5 @@ func init() {
|
|||||||
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text("请欣赏"+fc.FirstCategoryName+"的《"+tc.ThirdCategoryName+"》"))
|
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text("请欣赏"+fc.FirstCategoryName+"的《"+tc.ThirdCategoryName+"》"))
|
||||||
ctx.SendChain(message.Record(recordUrl))
|
ctx.SendChain(message.Record(recordUrl))
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user