Skip to content

Commit

Permalink
fix chess & kfc && optimize lolicon & bilibili (#817)
Browse files Browse the repository at this point in the history
* fix chess & kfc && optimize bilibili & lolicon

* chore(lint): 改进代码样式 (#27)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
Jiang-Red and github-actions[bot] committed Nov 12, 2023
1 parent 73b879a commit 61168ad
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions plugin/bilibili/bilibilipush.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ func init() {
"- 取消b站直播订阅[uid|name]\n" +
"- b站推送列表\n" +
"- [开启|关闭]艾特全体\n" +
"Tips: 需要配合job一起使用, 全局只需要设置一个, 无视响应状态推送, 下为例子\n" +
"记录在\"@every 5m\"触发的指令)\n" +
"Tips: 需要先在 bilibili 插件中设置cookie\n" +
"需要配合 job 插件一起使用, 全局只需要设置一个, 无视响应状态推送, 下为例子\n" +
"记录在\"@every 5m\"触发的指令\n" +
"拉取b站推送",
PrivateDataFolder: "bilibilipush",
})
Expand Down
4 changes: 2 additions & 2 deletions plugin/chess/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func resign(groupCode, senderUin int64) (msg message.Message, err error) {
}

// play 走棋
func play(senderUin int64, groupCode int64, moveStr string) (msg message.Message, err error) {
func play(groupCode, senderUin int64, moveStr string) (msg message.Message, err error) {
msg = message.Message{message.At(senderUin)}
// 检查对局是否存在
room, ok := chessRoomMap.Load(groupCode)
Expand Down Expand Up @@ -343,7 +343,7 @@ func cleanUserRate(senderUin int64) (msg message.Message, err error) {
}

// createGame 创建游戏
func createGame(isBlindfold bool, groupCode int64, senderUin int64, senderName string) (msg message.Message, err error) {
func createGame(isBlindfold bool, groupCode, senderUin int64, senderName string) (msg message.Message, err error) {
room, ok := chessRoomMap.Load(groupCode)
if !ok {
chessRoomMap.Store(groupCode, &chessRoom{
Expand Down
6 changes: 3 additions & 3 deletions plugin/kfccrazythursday/kfccrazythursday.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
package kfccrazythursday

import (
"github.com/FloatTech/floatbox/binary"
"github.com/FloatTech/floatbox/web"
ctrl "github.com/FloatTech/zbpctrl"
"github.com/FloatTech/zbputils/control"
"github.com/tidwall/gjson"
zero "github.com/wdvxdr1123/ZeroBot"
"github.com/wdvxdr1123/ZeroBot/message"
)

const (
crazyURL = "https://www.iculture.cc/demo/CrazyThursday/api/kfc.php"
crazyURL = "https://api.jixs.cc/api/wenan-fkxqs/index.php"
)

func init() {
Expand All @@ -26,6 +26,6 @@ func init() {
ctx.SendChain(message.Text("ERROR: ", err))
return
}
ctx.SendChain(message.Text(gjson.ParseBytes(data).Get("@this.0.content").String()))
ctx.SendChain(message.Text(binary.BytesToString(data)))
})
}
2 changes: 1 addition & 1 deletion plugin/lolicon/lolicon.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,5 @@ func getimgurl(url string) (string, error) {
if imageurl = json.Get("data.0.urls.original").Str; imageurl == "" {
return "", errors.New("未找到相关内容, 换个tag试试吧")
}
return strings.ReplaceAll(imageurl, "i.pixiv.cat", "i.pixiv.re"), nil
return imageurl, nil
}

0 comments on commit 61168ad

Please sign in to comment.