From ff3d1d1de3417bdb1d60adccf3a4478e59527f0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Wed, 8 Nov 2023 13:20:04 +0900 Subject: [PATCH 01/11] =?UTF-8?q?=F0=9F=90=9B=20custom=20lazy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/hyaku/main.go | 2 +- plugin/omikuji/sensou.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/hyaku/main.go b/plugin/hyaku/main.go index 7c7c3199f1..cf40b9b159 100644 --- a/plugin/hyaku/main.go +++ b/plugin/hyaku/main.go @@ -19,7 +19,7 @@ import ( "github.com/wdvxdr1123/ZeroBot/message" ) -const bed = "https://gitcode.net/u011570312/OguraHyakuninIsshu/-/raw/master/" +const bed = "https://gitea.seku.su/fumiama/OguraHyakuninIsshu/src/branch/master" type line struct { 番号, 歌人, 上の句, 下の句, 上の句ひらがな, 下の句ひらがな string diff --git a/plugin/omikuji/sensou.go b/plugin/omikuji/sensou.go index daa4dbeca2..23d750450a 100644 --- a/plugin/omikuji/sensou.go +++ b/plugin/omikuji/sensou.go @@ -17,7 +17,7 @@ import ( "github.com/FloatTech/zbputils/img/text" ) -const bed = "https://gitcode.net/u011570312/senso-ji-omikuji/-/raw/main/" +const bed = "https://gitea.seku.su/fumiama/senso-ji-omikuji/raw/branch/main" func init() { // 插件主体 engine := control.AutoRegister(&ctrl.Options[*zero.Ctx]{ From 17bfa2a35cb0dec450fbe9e93d7fc1669a8d1b09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Wed, 8 Nov 2023 13:20:32 +0900 Subject: [PATCH 02/11] =?UTF-8?q?=F0=9F=94=96=20v1.7.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kanban/banner/banner.go | 4 ++-- winres/winres.json | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/kanban/banner/banner.go b/kanban/banner/banner.go index 8263b72ed7..a75e7610a7 100644 --- a/kanban/banner/banner.go +++ b/kanban/banner/banner.go @@ -3,13 +3,13 @@ package banner // Version ... -var Version = "v1.7.4" +var Version = "v1.7.5" // Copyright ... var Copyright = "© 2020 - 2023 FloatTech" // Banner ... var Banner = "* OneBot + ZeroBot + Golang\n" + - "* Version " + Version + " - 2023-11-07 21:51:14 +0900 JST\n" + + "* Version " + Version + " - 2023-11-08 13:20:12 +0900 JST\n" + "* Copyright " + Copyright + ". All Rights Reserved.\n" + "* Project: https://github.com/FloatTech/ZeroBot-Plugin" diff --git a/winres/winres.json b/winres/winres.json index fbe7afad97..fddcd5102a 100644 --- a/winres/winres.json +++ b/winres/winres.json @@ -12,7 +12,7 @@ "0409": { "identity": { "name": "ZeroBot-Plugin", - "version": "1.7.4.1901" + "version": "1.7.5.1903" }, "description": "", "minimum-os": "vista", @@ -36,23 +36,23 @@ "#1": { "0000": { "fixed": { - "file_version": "1.7.4.1901", - "product_version": "v1.7.4", - "timestamp": "2023-11-07T21:51:24+08:00" + "file_version": "1.7.5.1903", + "product_version": "v1.7.5", + "timestamp": "2023-11-08T13:20:23+08:00" }, "info": { "0409": { "Comments": "OneBot plugins based on ZeroBot", "CompanyName": "FloatTech", "FileDescription": "https://github.com/FloatTech/ZeroBot-Plugin", - "FileVersion": "1.7.4.1901", + "FileVersion": "1.7.5.1903", "InternalName": "", "LegalCopyright": "© 2020 - 2023 FloatTech. All Rights Reserved.", "LegalTrademarks": "", "OriginalFilename": "ZBP.EXE", "PrivateBuild": "", "ProductName": "ZeroBot-Plugin", - "ProductVersion": "v1.7.4", + "ProductVersion": "v1.7.5", "SpecialBuild": "" } } From 0ea804fc868b5ce4602b0efc7f5ed2df70a0b175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Wed, 8 Nov 2023 14:13:26 +0900 Subject: [PATCH 03/11] fix: hyaku --- plugin/hyaku/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/hyaku/main.go b/plugin/hyaku/main.go index cf40b9b159..fb45755e1c 100644 --- a/plugin/hyaku/main.go +++ b/plugin/hyaku/main.go @@ -19,7 +19,7 @@ import ( "github.com/wdvxdr1123/ZeroBot/message" ) -const bed = "https://gitea.seku.su/fumiama/OguraHyakuninIsshu/src/branch/master" +const bed = "https://gitea.seku.su/fumiama/OguraHyakuninIsshu/raw/branch/master" type line struct { 番号, 歌人, 上の句, 下の句, 上の句ひらがな, 下の句ひらがな string From a5d2e3dfc3446714da37e0fc50471c46148a1a23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Wed, 8 Nov 2023 14:13:52 +0900 Subject: [PATCH 04/11] =?UTF-8?q?=F0=9F=94=96=20v1.7.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kanban/banner/banner.go | 4 ++-- winres/winres.json | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/kanban/banner/banner.go b/kanban/banner/banner.go index a75e7610a7..8f21540a97 100644 --- a/kanban/banner/banner.go +++ b/kanban/banner/banner.go @@ -3,13 +3,13 @@ package banner // Version ... -var Version = "v1.7.5" +var Version = "v1.7.6" // Copyright ... var Copyright = "© 2020 - 2023 FloatTech" // Banner ... var Banner = "* OneBot + ZeroBot + Golang\n" + - "* Version " + Version + " - 2023-11-08 13:20:12 +0900 JST\n" + + "* Version " + Version + " - 2023-11-08 14:13:37 +0900 JST\n" + "* Copyright " + Copyright + ". All Rights Reserved.\n" + "* Project: https://github.com/FloatTech/ZeroBot-Plugin" diff --git a/winres/winres.json b/winres/winres.json index fddcd5102a..5627491279 100644 --- a/winres/winres.json +++ b/winres/winres.json @@ -12,7 +12,7 @@ "0409": { "identity": { "name": "ZeroBot-Plugin", - "version": "1.7.5.1903" + "version": "1.7.6.1905" }, "description": "", "minimum-os": "vista", @@ -36,23 +36,23 @@ "#1": { "0000": { "fixed": { - "file_version": "1.7.5.1903", - "product_version": "v1.7.5", - "timestamp": "2023-11-08T13:20:23+08:00" + "file_version": "1.7.6.1905", + "product_version": "v1.7.6", + "timestamp": "2023-11-08T14:13:49+08:00" }, "info": { "0409": { "Comments": "OneBot plugins based on ZeroBot", "CompanyName": "FloatTech", "FileDescription": "https://github.com/FloatTech/ZeroBot-Plugin", - "FileVersion": "1.7.5.1903", + "FileVersion": "1.7.6.1905", "InternalName": "", "LegalCopyright": "© 2020 - 2023 FloatTech. All Rights Reserved.", "LegalTrademarks": "", "OriginalFilename": "ZBP.EXE", "PrivateBuild": "", "ProductName": "ZeroBot-Plugin", - "ProductVersion": "v1.7.5", + "ProductVersion": "v1.7.6", "SpecialBuild": "" } } From 73b879a6f409197e675588964e6759c069b6a390 Mon Sep 17 00:00:00 2001 From: Jiang-Red <79574799+Jiang-Red@users.noreply.github.com> Date: Wed, 8 Nov 2023 21:06:05 +0800 Subject: [PATCH 05/11] fix hyaku & omikuji lazy & score (#815) --- plugin/hyaku/main.go | 2 +- plugin/omikuji/sensou.go | 2 +- plugin/score/sign_in.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/hyaku/main.go b/plugin/hyaku/main.go index fb45755e1c..c42238e3ca 100644 --- a/plugin/hyaku/main.go +++ b/plugin/hyaku/main.go @@ -19,7 +19,7 @@ import ( "github.com/wdvxdr1123/ZeroBot/message" ) -const bed = "https://gitea.seku.su/fumiama/OguraHyakuninIsshu/raw/branch/master" +const bed = "https://gitea.seku.su/fumiama/OguraHyakuninIsshu/raw/branch/master/" type line struct { 番号, 歌人, 上の句, 下の句, 上の句ひらがな, 下の句ひらがな string diff --git a/plugin/omikuji/sensou.go b/plugin/omikuji/sensou.go index 23d750450a..5b3e754ee7 100644 --- a/plugin/omikuji/sensou.go +++ b/plugin/omikuji/sensou.go @@ -17,7 +17,7 @@ import ( "github.com/FloatTech/zbputils/img/text" ) -const bed = "https://gitea.seku.su/fumiama/senso-ji-omikuji/raw/branch/main" +const bed = "https://gitea.seku.su/fumiama/senso-ji-omikuji/raw/branch/main/" func init() { // 插件主体 engine := control.AutoRegister(&ctrl.Options[*zero.Ctx]{ diff --git a/plugin/score/sign_in.go b/plugin/score/sign_in.go index 61303a0090..8c25b41a63 100644 --- a/plugin/score/sign_in.go +++ b/plugin/score/sign_in.go @@ -52,6 +52,7 @@ var ( func init() { cachePath := engine.DataFolder() + "cache/" go func() { + sdb = initialize(engine.DataFolder() + "score.db") ok := file.IsExist(cachePath) if !ok { err := os.MkdirAll(cachePath, 0777) @@ -68,7 +69,6 @@ func init() { } } } - sdb = initialize(engine.DataFolder() + "score.db") }() engine.OnRegex(`^签到\s?(\d*)$`).Limit(ctxext.LimitByUser).SetBlock(true).Handle(func(ctx *zero.Ctx) { // 选择key From 61168adb2e4e1ddb5ae1b2952db8755760065db0 Mon Sep 17 00:00:00 2001 From: Jiang-Red <79574799+Jiang-Red@users.noreply.github.com> Date: Sun, 12 Nov 2023 13:21:37 +0800 Subject: [PATCH 06/11] fix chess & kfc && optimize lolicon & bilibili (#817) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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> --- plugin/bilibili/bilibilipush.go | 5 +++-- plugin/chess/core.go | 4 ++-- plugin/kfccrazythursday/kfccrazythursday.go | 6 +++--- plugin/lolicon/lolicon.go | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/plugin/bilibili/bilibilipush.go b/plugin/bilibili/bilibilipush.go index e95aec1fa6..f114d78ee2 100644 --- a/plugin/bilibili/bilibilipush.go +++ b/plugin/bilibili/bilibilipush.go @@ -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", }) diff --git a/plugin/chess/core.go b/plugin/chess/core.go index aecbf0d0d3..d3e0926b04 100644 --- a/plugin/chess/core.go +++ b/plugin/chess/core.go @@ -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) @@ -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{ diff --git a/plugin/kfccrazythursday/kfccrazythursday.go b/plugin/kfccrazythursday/kfccrazythursday.go index 22faee506c..971dd1e452 100644 --- a/plugin/kfccrazythursday/kfccrazythursday.go +++ b/plugin/kfccrazythursday/kfccrazythursday.go @@ -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() { @@ -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))) }) } diff --git a/plugin/lolicon/lolicon.go b/plugin/lolicon/lolicon.go index 516a4ca3b9..25f5eb3465 100644 --- a/plugin/lolicon/lolicon.go +++ b/plugin/lolicon/lolicon.go @@ -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 } From 54c67e30f4a017fb590b617ae466ed26775147a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Sun, 19 Nov 2023 19:03:28 +0900 Subject: [PATCH 07/11] fix: danbooru --- plugin/danbooru/tag.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugin/danbooru/tag.go b/plugin/danbooru/tag.go index 7df564923e..0e29c70e33 100644 --- a/plugin/danbooru/tag.go +++ b/plugin/danbooru/tag.go @@ -3,6 +3,7 @@ package deepdanbooru import ( "bytes" "encoding/json" + "errors" "fmt" "image" "net/url" @@ -59,8 +60,12 @@ func tagurl(name, u string) (im image.Image, st *sorttags, err error) { if err != nil { return } + if len(data) < 4 { + err = errors.New("data too short") + return + } tags := make(map[string]float64) - err = json.Unmarshal(data, &tags) + err = json.Unmarshal(data[1:len(data)-1], &tags) if err != nil { return } From a006b30392255737db50ca0db402b2c0eb9bc2c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Thu, 28 Dec 2023 16:34:06 +0900 Subject: [PATCH 08/11] Update pull.yml --- .github/workflows/pull.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 99c59eb62b..52b6d117c0 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -17,7 +17,7 @@ jobs: uses: superbrothers/close-pull-request@v3 with: # Optional. Post a issue comment just before closing a pull request. - comment: "非法PR. 请`fork`后修改自己的仓库, 而不是向主仓库提交更改. 如果您确信您的PR是为了给主仓库新增功能或修复bug, 请更改默认PR标题." + comment: "非法PR. 请`fork`后修改自己的仓库, 而不是向主仓库提交更改. 如果您确信您的PR是为了给主仓库新增功能或修复bug, 请更改默认PR标题. **注意**: 如果您再次触发本提示, 则有可能导致账号被封禁." golangci: name: lint From 9c65383a7c21185aabe46183e2191f219117d3e3 Mon Sep 17 00:00:00 2001 From: vatebur <67186678+vatebur@users.noreply.github.com> Date: Thu, 25 Jan 2024 16:40:11 +0800 Subject: [PATCH 09/11] update guessmusic:Reduce the difficulty (#854) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update guessmusic:Reduce the difficulty 猜歌时忽略大小写和简繁体,降低猜歌难度 * chore(lint): 改进代码样式 --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- go.mod | 6 +++++- go.sum | 8 ++++++++ plugin/guessmusic/guessmusic.go | 29 +++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 8f29188cc3..ef5416dd63 100644 --- a/go.mod +++ b/go.mod @@ -24,6 +24,7 @@ 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 @@ -31,6 +32,7 @@ require ( github.com/jozsefsallai/gophersauce v1.0.1 github.com/kanrichan/resvg-go v0.0.2-0.20231001163256-63db194ca9f5 github.com/lithammer/fuzzysearch v1.1.5 + github.com/liuzl/gocc v0.0.0-20231231122217-0372e1059ca5 github.com/mroth/weightedrand v1.0.0 github.com/notnil/chess v1.9.0 github.com/pkg/errors v0.9.1 @@ -48,13 +50,13 @@ require ( ) require ( + github.com/adamzy/cedar-go v0.0.0-20170805034717-80a9c64b256d // indirect github.com/ajstarks/svgo v0.0.0-20200320125537-f189e35d30ca // indirect github.com/antchfx/xpath v1.2.1 // indirect github.com/ericpauley/go-quantize v0.0.0-20200331213906-ae555eb2afa4 // indirect 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 @@ -67,6 +69,8 @@ require ( github.com/jfreymuth/vorbis v1.0.0 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/kr/pretty v0.3.1 // indirect + github.com/liuzl/cedar-go v0.0.0-20170805034717-80a9c64b256d // indirect + github.com/liuzl/da v0.0.0-20180704015230-14771aad5b1d // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/mattn/go-isatty v0.0.16 // indirect github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect diff --git a/go.sum b/go.sum index 8238c471a0..8e9eed39fd 100644 --- a/go.sum +++ b/go.sum @@ -25,6 +25,8 @@ github.com/RomiChan/syncx v0.0.0-20221202055724-5f842c53020e h1:wR3MXQ3VbUlPKOOU github.com/RomiChan/syncx v0.0.0-20221202055724-5f842c53020e/go.mod h1:vD7Ra3Q9onRtojoY5sMCLQ7JBgjUsrXDnDKyFxqpf9w= github.com/RomiChan/websocket v1.4.3-0.20220227141055-9b2c6168c9c5 h1:bBmmB7he0iVN4m5mcehfheeRUEer/Avo4ujnxI3uCqs= github.com/RomiChan/websocket v1.4.3-0.20220227141055-9b2c6168c9c5/go.mod h1:0UcFaCkhp6vZw6l5Dpq0Dp673CoF9GdvA8lTfst0GiU= +github.com/adamzy/cedar-go v0.0.0-20170805034717-80a9c64b256d h1:ir/IFJU5xbja5UaBEQLjcvn7aAU01nqU/NUyOBEU+ew= +github.com/adamzy/cedar-go v0.0.0-20170805034717-80a9c64b256d/go.mod h1:PRWNwWq0yifz6XDPZu48aSld8BWwBfr2JKB2bGWiEd4= github.com/ajstarks/svgo v0.0.0-20200320125537-f189e35d30ca h1:kWzLcty5V2rzOqJM7Tp/MfSX0RMSI1x4IOLApEefYxA= github.com/ajstarks/svgo v0.0.0-20200320125537-f189e35d30ca/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= @@ -142,6 +144,12 @@ github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lithammer/fuzzysearch v1.1.5 h1:Ag7aKU08wp0R9QCfF4GoGST9HbmAIeLP7xwMrOBEp1c= github.com/lithammer/fuzzysearch v1.1.5/go.mod h1:1R1LRNk7yKid1BaQkmuLQaHruxcC4HmAH30Dh61Ih1Q= +github.com/liuzl/cedar-go v0.0.0-20170805034717-80a9c64b256d h1:qSmEGTgjkESUX5kPMSGJ4pcBUtYVDdkNzMrjQyvRvp0= +github.com/liuzl/cedar-go v0.0.0-20170805034717-80a9c64b256d/go.mod h1:x7SghIWwLVcJObXbjK7S2ENsT1cAcdJcPl7dRaSFog0= +github.com/liuzl/da v0.0.0-20180704015230-14771aad5b1d h1:hTRDIpJ1FjS9ULJuEzu69n3qTgc18eI+ztw/pJv47hs= +github.com/liuzl/da v0.0.0-20180704015230-14771aad5b1d/go.mod h1:7xD3p0XnHvJFQ3t/stEJd877CSIMkH/fACVWen5pYnc= +github.com/liuzl/gocc v0.0.0-20231231122217-0372e1059ca5 h1:wnbHIeP1UX8ClYEWKGnw66PfYvReCHu9G5lXSte3Sqc= +github.com/liuzl/gocc v0.0.0-20231231122217-0372e1059ca5/go.mod h1:7KaV9YIR92M1FpbczAcfYQ3UZ5ayT27pNtunDmXvLBo= github.com/lucasb-eyer/go-colorful v1.0.2/go.mod h1:0MS4r+7BZKSJ5mw4/S5MPN+qHFF1fYclkSPilDOKW0s= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= diff --git a/plugin/guessmusic/guessmusic.go b/plugin/guessmusic/guessmusic.go index 4b19175ab5..34dc920a6b 100644 --- a/plugin/guessmusic/guessmusic.go +++ b/plugin/guessmusic/guessmusic.go @@ -11,16 +11,28 @@ import ( "sync" "time" + log "github.com/sirupsen/logrus" + "github.com/FloatTech/floatbox/file" "github.com/FloatTech/zbputils/ctxext" "github.com/pkg/errors" zero "github.com/wdvxdr1123/ZeroBot" "github.com/wdvxdr1123/ZeroBot/message" + + "github.com/liuzl/gocc" ) var cuttime = [...]string{"00:00:05", "00:00:30", "00:01:00"} // 音乐切割时间点,可自行调节时间(时:分:秒) +var t2s *gocc.OpenCC func init() { + // 初始化简繁体转换变量 + var err1 error + t2s, err1 = gocc.New("t2s") + if err1 != nil { + log.Infof("[guessmusic]:%s", err1) + } + engine.OnRegex(`^(个人|团队)猜歌(-(.*))?$`, zero.OnlyGroup).SetBlock(true).Limit(ctxext.LimitByGroup). Handle(func(ctx *zero.Ctx) { mode := ctx.State["regex_matched"].([]string)[3] @@ -283,6 +295,11 @@ func cutMusic(musicName, pathOfMusic, outputPath string) (err error) { // 数据匹配(结果信息,答题次数,提示次数,是否结束游戏) func gameMatch(c *zero.Ctx, beginner int64, musicInfo []string, answerTimes, tickTimes int) (message.MessageSegment, int, int, bool) { answer := strings.Replace(c.Event.Message.String(), "-", "", 1) + // 大小写,简繁体转换 + answer = ConvertText(answer) + for i, element := range musicInfo { + musicInfo[i] = ConvertText(element) + } switch { case answer == "取消": if c.Event.UserID == beginner { @@ -314,3 +331,15 @@ func gameMatch(c *zero.Ctx, beginner int64, musicInfo []string, answerTimes, tic } } } + +// ConvertText 将传入字符串中的英文转为小写,繁体中文转为简体中文 +func ConvertText(input string) string { + // 将字符串中的英文转为小写 + toLower := strings.ToLower(input) + toLower, err := t2s.Convert(toLower) + if err != nil { + message.Text("简繁转换失败") + return toLower + } + return toLower +} From b8858f0acdb6c24d0260b11a6fe58583245b7f79 Mon Sep 17 00:00:00 2001 From: vatebur <67186678+vatebur@users.noreply.github.com> Date: Thu, 25 Jan 2024 16:44:06 +0800 Subject: [PATCH 10/11] [issues 840] Modify the "score" of the Image send type add base64 (#853) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modify the "score":Image send type add base64 适配shamrock,以路径发送图片失败后,使用base64发送图片。 --- plugin/score/sign_in.go | 43 ++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/plugin/score/sign_in.go b/plugin/score/sign_in.go index 8c25b41a63..fd5ef0142a 100644 --- a/plugin/score/sign_in.go +++ b/plugin/score/sign_in.go @@ -2,6 +2,8 @@ package score import ( + "encoding/base64" + "io" "math" "math/rand" "os" @@ -106,7 +108,7 @@ func init() { // 如果签到时间是今天 ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text("今天你已经签到过了!")) if file.IsExist(drawedFile) { - ctx.SendChain(message.Image("file:///" + file.BOTPATH + "/" + drawedFile)) + trySendImage(drawedFile, ctx) } return case siUpdateTimeStr != today: @@ -176,7 +178,7 @@ func init() { ctx.SendChain(message.Text("ERROR: ", err)) return } - ctx.SendChain(message.Image("file:///" + file.BOTPATH + "/" + drawedFile)) + trySendImage(drawedFile, ctx) }) engine.OnPrefix("获得签到背景", zero.OnlyGroup).Limit(ctxext.LimitByGroup).SetBlock(true). @@ -193,16 +195,14 @@ func init() { ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text("请先签到!")) return } - if id := ctx.SendChain(message.Image("file:///" + file.BOTPATH + "/" + picFile)); id.ID() == 0 { - ctx.SendChain(message.Text("ERROR: 消息发送失败, 账号可能被风控")) - } + trySendImage(picFile, ctx) }) engine.OnFullMatch("查看等级排名", zero.OnlyGroup).Limit(ctxext.LimitByGroup).SetBlock(true). Handle(func(ctx *zero.Ctx) { today := time.Now().Format("20060102") drawedFile := cachePath + today + "scoreRank.png" if file.IsExist(drawedFile) { - ctx.SendChain(message.Image("file:///" + file.BOTPATH + "/" + drawedFile)) + trySendImage(drawedFile, ctx) return } st, err := sdb.GetScoreRankByTopN(10) @@ -267,7 +267,7 @@ func init() { ctx.SendChain(message.Text("ERROR: ", err)) return } - ctx.SendChain(message.Image("file:///" + file.BOTPATH + "/" + drawedFile)) + trySendImage(drawedFile, ctx) }) engine.OnRegex(`^设置签到预设\s*(\d+)$`, zero.SuperUserPermission).Limit(ctxext.LimitByUser).SetBlock(true).Handle(func(ctx *zero.Ctx) { key := ctx.State["regex_matched"].([]string)[1] @@ -342,3 +342,32 @@ func initPic(picFile string, uid int64) (avatar []byte, err error) { } return avatar, os.WriteFile(picFile, data, 0644) } + +// 使用"file:"发送图片失败后,改用base64发送 +func trySendImage(filePath string, ctx *zero.Ctx) { + filePath = file.BOTPATH + "/" + filePath + if id := ctx.SendChain(message.Image("file:///" + filePath)); id.ID() != 0 { + return + } + imgFile, err := os.Open(filePath) + if err != nil { + ctx.SendChain(message.Text("ERROR: 无法打开文件", err)) + return + } + defer imgFile.Close() + // 使用 base64.NewEncoder 将文件内容编码为 base64 字符串 + var encodedFileData strings.Builder + encodedFileData.WriteString("base64://") + encoder := base64.NewEncoder(base64.StdEncoding, &encodedFileData) + _, err = io.Copy(encoder, imgFile) + if err != nil { + ctx.SendChain(message.Text("ERROR: 无法编码文件内容", err)) + return + } + encoder.Close() + drawedFileBase64 := encodedFileData.String() + if id := ctx.SendChain(message.Image(drawedFileBase64)); id.ID() == 0 { + ctx.SendChain(message.Text("ERROR: 无法读取图片文件", err)) + return + } +} From 6f2c9f7fc018e890247af46d8ad8c5da6a7e4549 Mon Sep 17 00:00:00 2001 From: Nobody6825 <117302867+Nobooooody@users.noreply.github.com> Date: Sat, 27 Jan 2024 15:11:24 +0800 Subject: [PATCH 11/11] Initial Commit for nix (#856) * Initial Commit for nix * Update description * nix fmt * update version --------- Co-authored-by: anonymous <anonymous@anonymous.anonymous44> --- .envrc | 1 + .gitignore | 1 + default.nix | 25 +++++ flake.lock | 85 +++++++++++++++ flake.nix | 36 +++++++ gomod2nix.toml | 284 +++++++++++++++++++++++++++++++++++++++++++++++++ shell.nix | 23 ++++ 7 files changed, 455 insertions(+) create mode 100644 .envrc create mode 100644 default.nix create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 gomod2nix.toml create mode 100644 shell.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000000..3550a30f2d --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index 614e9277f3..2d1d82a57f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ nohup.out zerobot ZeroBot-Plugin* *.syso +/.direnv diff --git a/default.nix b/default.nix new file mode 100644 index 0000000000..b7b0081310 --- /dev/null +++ b/default.nix @@ -0,0 +1,25 @@ +{ + pkgs ? ( + let + inherit (builtins) fetchTree fromJSON readFile; + inherit ((fromJSON (readFile ./flake.lock)).nodes) nixpkgs gomod2nix; + in + import (fetchTree nixpkgs.locked) { + overlays = [ + (import "${fetchTree gomod2nix.locked}/overlay.nix") + ]; + } + ), + buildGoApplication ? pkgs.buildGoApplication, +}: +buildGoApplication { + pname = "ZeroBot-Plugin"; + version = "1.7.6"; + pwd = ./.; + src = ./.; + # spec go version manually bcs + # https://github.com/nix-community/gomod2nix/blob/30e3c3a9ec4ac8453282ca7f67fca9e1da12c3e6/builder/default.nix#L130 + # do no work + go = pkgs.go_1_20; + modules = ./gomod2nix.toml; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000000..4f1a905faa --- /dev/null +++ b/flake.lock @@ -0,0 +1,85 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gomod2nix": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1705314449, + "narHash": "sha256-yfQQ67dLejP0FLK76LKHbkzcQqNIrux6MFe32MMFGNQ=", + "owner": "nix-community", + "repo": "gomod2nix", + "rev": "30e3c3a9ec4ac8453282ca7f67fca9e1da12c3e6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "gomod2nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1705856552, + "narHash": "sha256-JXfnuEf5Yd6bhMs/uvM67/joxYKoysyE3M2k6T3eWbg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "612f97239e2cc474c13c9dafa0df378058c5ad8d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "gomod2nix": "gomod2nix", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000000..3493c0eda3 --- /dev/null +++ b/flake.nix @@ -0,0 +1,36 @@ +{ + description = "基于 ZeroBot 的 OneBot 插件"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + inputs.gomod2nix.url = "github:nix-community/gomod2nix"; + inputs.gomod2nix.inputs.nixpkgs.follows = "nixpkgs"; + inputs.gomod2nix.inputs.flake-utils.follows = "flake-utils"; + + outputs = { + self, + nixpkgs, + flake-utils, + gomod2nix, + }: ( + flake-utils.lib.eachDefaultSystem + (system: let + pkgs = nixpkgs.legacyPackages.${system}; + + # The current default sdk for macOS fails to compile go projects, so we use a newer one for now. + # This has no effect on other platforms. + callPackage = pkgs.darwin.apple_sdk_11_0.callPackage or pkgs.callPackage; + in { + # doCheck will fail at write files + packages.default = + (callPackage ./. { + inherit (gomod2nix.legacyPackages.${system}) buildGoApplication; + }) + .overrideAttrs (_: {doCheck = false;}); + devShells.default = callPackage ./shell.nix { + inherit (gomod2nix.legacyPackages.${system}) mkGoEnv gomod2nix; + }; + formatter = pkgs.alejandra; + }) + ); +} diff --git a/gomod2nix.toml b/gomod2nix.toml new file mode 100644 index 0000000000..1f9831587f --- /dev/null +++ b/gomod2nix.toml @@ -0,0 +1,284 @@ +schema = 3 + +[mod] + [mod."github.com/Baidu-AIP/golang-sdk"] + version = "v1.1.1" + hash = "sha256-hKshA0K92bKuK92mmtM0osVmqLJcSbeobeWSDpQoRCo=" + [mod."github.com/FloatTech/AnimeAPI"] + version = "v1.7.1-0.20231017135344-aefd1d56e900" + hash = "sha256-YV9VQ7bA8R5g5dcAsbzS6MicVwDgMu08d9GF4uqXH7M=" + [mod."github.com/FloatTech/floatbox"] + version = "v0.0.0-20231107124407-e38535efa2a2" + hash = "sha256-B86GBuJAjeFjhAjNbBF6OO6DTH2/fpPkrdQynwX+sxg=" + [mod."github.com/FloatTech/gg"] + version = "v1.1.3-0.20230226151425-6ea91286ba08" + hash = "sha256-AeMzjMK1ZwFERb5xuNAV5PdHp7rzoT4ZF7kZ6Kj2/0s=" + [mod."github.com/FloatTech/imgfactory"] + version = "v0.2.2-0.20230413152719-e101cc3606ef" + hash = "sha256-2okFyPQSYIxrc8hxICsbjEM9xq25a3I2A4wmDIYFCg8=" + [mod."github.com/FloatTech/rendercard"] + version = "v0.0.10-0.20230223064326-45d29fa4ede9" + hash = "sha256-Zn8agmyWWEC2QQfIBa60jlQrEap9Bps+z1Ekay6Y0cg=" + [mod."github.com/FloatTech/sqlite"] + version = "v1.6.3" + hash = "sha256-zWPByEMi89ms67ubPg0fAPIRxfpBC2IRKc0iNVLqkPU=" + [mod."github.com/FloatTech/ttl"] + version = "v0.0.0-20220715042055-15612be72f5b" + hash = "sha256-vVQTn7f2dFPNrLqutWbeHMCpEdNi7uPxUzpphzaYPpM=" + [mod."github.com/FloatTech/zbpctrl"] + version = "v1.6.0" + hash = "sha256-2ZPGFvSgTWcPOo8+p8kmg590HY2b8v/L3674ba+b7+A=" + [mod."github.com/FloatTech/zbputils"] + version = "v1.7.1-0.20231107124514-083e678fbfe6" + hash = "sha256-Bg3aAI8oDx71kWielITcK5Rg2H47/DQZX+4+dO5AtK4=" + [mod."github.com/RomiChan/syncx"] + version = "v0.0.0-20221202055724-5f842c53020e" + hash = "sha256-FbmvziRRDEzeXW17IQdyWMWsCVq4fvwKGjbFZqJKAMQ=" + [mod."github.com/RomiChan/websocket"] + version = "v1.4.3-0.20220227141055-9b2c6168c9c5" + hash = "sha256-Adx+gvqB+CCoUXx7ebIaBDjVkav+wS5qZPmaqcApBWA=" + [mod."github.com/adamzy/cedar-go"] + version = "v0.0.0-20170805034717-80a9c64b256d" + hash = "sha256-N19KTxh70IUBqnchFuWkrJD8uuFOIVqv1iSuN3YFIT0=" + [mod."github.com/ajstarks/svgo"] + version = "v0.0.0-20200320125537-f189e35d30ca" + hash = "sha256-ALeRuEJN9jHjGb4wNKJcxC59vVx8Tj7hHikEGkaZZ0s=" + [mod."github.com/antchfx/htmlquery"] + version = "v1.2.5" + hash = "sha256-lkpdz+NNHadn0VIshszAZS5ZodOic0sp2d7VN6sIl/M=" + [mod."github.com/antchfx/xpath"] + version = "v1.2.1" + hash = "sha256-ffHNkJiraDyjy6NsFDNTfqreiY+DER/93J/i11xUPw8=" + [mod."github.com/corona10/goimagehash"] + version = "v1.1.0" + hash = "sha256-HyS8nc7kUNnDaVBDzJ9Ym4pRs83YB4M2vHSRwfm6mr4=" + [mod."github.com/davidscholberg/go-durationfmt"] + version = "v0.0.0-20170122144659-64843a2083d3" + hash = "sha256-0rdbpBf3AAjMpxvVEGFb2ImgB2i7vdEhIwCyqJs1iHE=" + [mod."github.com/disintegration/imaging"] + version = "v1.6.2" + hash = "sha256-pSeMTPvSkxlthh65LjNYYhPLvCZDkBgVgAGYWW0Aguo=" + [mod."github.com/ericpauley/go-quantize"] + version = "v0.0.0-20200331213906-ae555eb2afa4" + hash = "sha256-sMN6D7IlDpDqUWM8ppoE5Sdb7DvLAJaN6qAucBWJ3rs=" + [mod."github.com/faiface/beep"] + version = "v1.1.0" + hash = "sha256-66qAbnJjUjhXofxlGCa6G1+vjQcSTyN/POCZvYzHaQo=" + [mod."github.com/fumiama/ahsai"] + version = "v0.1.0" + hash = "sha256-lSoos+SFjALcL0ZYPsbOb8wntwn2fcubvSsz0YKgL9c=" + [mod."github.com/fumiama/cron"] + version = "v1.3.0" + hash = "sha256-/sN7X8dKXQgv8J+EDzVUB+o+AY9gBC8e1C6sYhaTy1k=" + [mod."github.com/fumiama/go-base16384"] + version = "v1.7.0" + hash = "sha256-vTAsBBYe2ISzb2Nba5E96unodZSkhMcqo6hbwR01nz8=" + [mod."github.com/fumiama/go-registry"] + version = "v0.2.6" + hash = "sha256-DgkdYYWsCs/bBrIiCHK4tPInv8pTy5/AqwHmI5UPTo8=" + [mod."github.com/fumiama/go-simple-protobuf"] + version = "v0.1.0" + hash = "sha256-itOBeIU4PRBANDP79eRWlCDNhNUnde6dgcpUlUbm0zU=" + [mod."github.com/fumiama/gofastTEA"] + version = "v0.0.10" + hash = "sha256-FOCbkXoS8s/K54yZbhX5pmaN/ouELnCHZoNS8a90VAg=" + [mod."github.com/fumiama/gotracemoe"] + version = "v0.0.3" + hash = "sha256-O3cDkVXu5NG1ZtzubxhH+S91zfgu4uH1L+OiSGYSNXQ=" + [mod."github.com/fumiama/imgsz"] + version = "v0.0.2" + hash = "sha256-eYUjP1TKWUrsY++rzg4rezOvmvmjADZFBizIIDHnZtY=" + [mod."github.com/fumiama/jieba"] + version = "v0.0.0-20221203025406-36c17a10b565" + hash = "sha256-DvDx1pdldkdaSszrbadM/VwqT9TTSmWl6G6a+ysXYEM=" + [mod."github.com/fumiama/unibase2n"] + version = "v0.0.0-20221020155353-02876e777430" + hash = "sha256-//vCLy5/vgId7m9WnRGqmh/wnglboiYz2YzQruIe97o=" + [mod."github.com/gabriel-vasile/mimetype"] + version = "v1.0.4" + hash = "sha256-5hl9zBo3nkPt8dZfcLoOix8lAKLm3qIkWhopoS4V34E=" + [mod."github.com/go-ole/go-ole"] + version = "v1.2.6" + hash = "sha256-+oxitLeJxYF19Z6g+6CgmCHJ1Y5D8raMi2Cb3M6nXCs=" + [mod."github.com/go-task/slim-sprig"] + version = "v0.0.0-20230315185526-52ccab3ef572" + hash = "sha256-D6NjCQbcYC53NdwzyAm4i9M1OjTJIVu4EIt3AD/Vxfg=" + [mod."github.com/golang/freetype"] + version = "v0.0.0-20170609003504-e2365dfdc4a0" + hash = "sha256-AHAFBd20/tqxohkWyQkui2bUef9i1HWYgk9LOIFErvA=" + [mod."github.com/golang/groupcache"] + version = "v0.0.0-20210331224755-41bb18bfe9da" + hash = "sha256-7Gs7CS9gEYZkbu5P4hqPGBpeGZWC64VDwraSKFF+VR0=" + [mod."github.com/golang/mock"] + version = "v1.6.0" + hash = "sha256-fWdnMQisRbiRzGT3ISrUHovquzLRHWvcv1JEsJFZRno=" + [mod."github.com/google/pprof"] + version = "v0.0.0-20210407192527-94a9f03dee38" + hash = "sha256-ryvI75ePFCfy0qvAhEFbtB/c/Er7nvLwm7CVASBRhsI=" + [mod."github.com/google/uuid"] + version = "v1.3.0" + hash = "sha256-QoR55eBtA94T2tBszyxfDtO7/pjZZSGb5vm7U0Xhs0Y=" + [mod."github.com/hajimehoshi/oto"] + version = "v0.7.1" + hash = "sha256-eRgbEbsziY5F0oI7wAe29FepZG7uGmq2M4deouDHcXI=" + [mod."github.com/jfreymuth/oggvorbis"] + version = "v1.0.1" + hash = "sha256-DpkiTLxAA/iCoiylpNRvMzvaDWtK+U4UMJYNnnCmJMU=" + [mod."github.com/jfreymuth/vorbis"] + version = "v1.0.0" + hash = "sha256-6kTol+g3NnZ3MazD786fvraw7ydUf0RWNBzHpzgN9Jk=" + [mod."github.com/jinzhu/gorm"] + version = "v1.9.16" + hash = "sha256-qKEwgNE8NxcX1uzT20LwC1TKVmve/nIy+oxdAKlxAuc=" + [mod."github.com/jinzhu/inflection"] + version = "v1.0.0" + hash = "sha256-3h3pHib5MaCXKyKLIMyQnSptDJ16kPjCOQPoEBoQsZg=" + [mod."github.com/jozsefsallai/gophersauce"] + version = "v1.0.1" + hash = "sha256-29DsfnGmK51DPunR/leRBKCcokN/yLoB7S2HxCsqtgY=" + [mod."github.com/kanrichan/resvg-go"] + version = "v0.0.2-0.20231001163256-63db194ca9f5" + hash = "sha256-plRZ3yhyCafCXmAD4vnFUoCTRsHmLp7Jn9gFKcEKbds=" + [mod."github.com/kr/pretty"] + version = "v0.3.1" + hash = "sha256-DlER7XM+xiaLjvebcIPiB12oVNjyZHuJHoRGITzzpKU=" + [mod."github.com/lithammer/fuzzysearch"] + version = "v1.1.5" + hash = "sha256-2vJLR4z5o3ch9q4tV7NT5RnfNxEdYspjI8YxQao2A6w=" + [mod."github.com/liuzl/cedar-go"] + version = "v0.0.0-20170805034717-80a9c64b256d" + hash = "sha256-N19KTxh70IUBqnchFuWkrJD8uuFOIVqv1iSuN3YFIT0=" + [mod."github.com/liuzl/da"] + version = "v0.0.0-20180704015230-14771aad5b1d" + hash = "sha256-J43kwDFmB6LzDhS3Ig/4ddZUTXz1cKztbTA3hILScs8=" + [mod."github.com/liuzl/gocc"] + version = "v0.0.0-20231231122217-0372e1059ca5" + hash = "sha256-Dr1xDbO+eR4Y/EpPgQ/S6g6C5etRFKWr8de77skcJR8=" + [mod."github.com/lufia/plan9stats"] + version = "v0.0.0-20211012122336-39d0f177ccd0" + hash = "sha256-thb+rkDx5IeWMgw5/5jgu5gZ+6RjJAUXeMgSkJHhRlA=" + [mod."github.com/mattn/go-isatty"] + version = "v0.0.16" + hash = "sha256-YMaPZvShDfA98vqw1+zWWl7M1IT4nHPGBrAt7kHo8Iw=" + [mod."github.com/mroth/weightedrand"] + version = "v1.0.0" + hash = "sha256-bP+yIaBUY5+oI455mNM8zh14z/SNPaQg44L3RJ0/v/c=" + [mod."github.com/nfnt/resize"] + version = "v0.0.0-20180221191011-83c6a9932646" + hash = "sha256-yvPV+HlDOyJsiwAcVHQkmtw8DHSXyw+cXHkigXm8rAA=" + [mod."github.com/notnil/chess"] + version = "v1.9.0" + hash = "sha256-2bHp/H5hBE/hPMT1HLOBqMaCZ/DYWJMDri26O9Yzoms=" + [mod."github.com/onsi/ginkgo/v2"] + version = "v2.9.5" + hash = "sha256-3HO85y+nGsg92NEg3OOYXy5GxB59Yl1idF5sBZnyIi4=" + [mod."github.com/pbnjay/memory"] + version = "v0.0.0-20210728143218-7b4eea64cf58" + hash = "sha256-QI+F1oPLOOtwNp8+m45OOoSfYFs3QVjGzE0rFdpF/IA=" + [mod."github.com/pkg/errors"] + version = "v0.9.1" + hash = "sha256-mNfQtcrQmu3sNg/7IwiieKWOgFQOVVe2yXgKBpe/wZw=" + [mod."github.com/pkumza/numcn"] + version = "v1.0.0" + hash = "sha256-cPxqj5tb10+MurN1Lehkk/v8KjaxXpL08+pVgL4x4Hg=" + [mod."github.com/power-devops/perfstat"] + version = "v0.0.0-20210106213030-5aafc221ea8c" + hash = "sha256-ywykDYuqcMt0TvZOz1l9Z6Z2JMTYQw8cP2fT8AtpmX4=" + [mod."github.com/quic-go/qpack"] + version = "v0.4.0" + hash = "sha256-QWIumzmHD94DlNp9G3AQf9QCtF+Kv0pShT1+FH7/I/c=" + [mod."github.com/quic-go/qtls-go1-20"] + version = "v0.3.3" + hash = "sha256-YiT0g2gUxaZgJlQqQDkQqJme44LYHdzErHVEbY3bIa0=" + [mod."github.com/quic-go/quic-go"] + version = "v0.38.1" + hash = "sha256-CC1E4sLcoMA1Jb9QdiVBaBq9GNUmxAPGBz3f/SJaHDY=" + [mod."github.com/remyoudompheng/bigfft"] + version = "v0.0.0-20211011143303-6e0bfa3c836b" + hash = "sha256-SHwiLdLvGHYnbWm+03ddYc2550RdFdx/VadJfZyQEKA=" + replaced = "github.com/fumiama/bigfft" + [mod."github.com/shirou/gopsutil/v3"] + version = "v3.23.1" + hash = "sha256-DYoN9o+PGrnYev7i+NISAKEqFdCKpimpi4s0FWmFpkY=" + [mod."github.com/sirupsen/logrus"] + version = "v1.9.3" + hash = "sha256-EnxsWdEUPYid+aZ9H4/iMTs1XMvCLbXZRDyvj89Ebms=" + [mod."github.com/tetratelabs/wazero"] + version = "v1.5.0" + hash = "sha256-fGdJM4LJrZA9jxHuYVo4EUQ3I1k0IVG3QQCBCgZkeZI=" + [mod."github.com/tidwall/gjson"] + version = "v1.14.4" + hash = "sha256-3DS2YNL95wG0qSajgRtIABD32J+oblaKVk8LIw+KSOc=" + [mod."github.com/tidwall/match"] + version = "v1.1.1" + hash = "sha256-M2klhPId3Q3T3VGkSbOkYl/2nLHnsG+yMbXkPkyrRdg=" + [mod."github.com/tidwall/pretty"] + version = "v1.2.0" + hash = "sha256-esRQGsn2Ee/CiySlwyuOICSLdqUkH4P7u8qXszos8Yc=" + [mod."github.com/tklauser/go-sysconf"] + version = "v0.3.11" + hash = "sha256-io8s7PJi4OX+wXkCm+v5pKy4yiqA/RE/I4ksy6mKX30=" + [mod."github.com/tklauser/numcpus"] + version = "v0.6.0" + hash = "sha256-6jssTsP5L6yVl43tXfqDdgeI+tEkBp3BpiWwKXLTHAM=" + [mod."github.com/wcharczuk/go-chart/v2"] + version = "v2.1.0" + hash = "sha256-0s07aT7i3zMyVaS1hHO6SaCilVy39HwC8Po6wcENn9E=" + [mod."github.com/wdvxdr1123/ZeroBot"] + version = "v1.7.5-0.20231009162356-57f71b9f5258" + hash = "sha256-sIrH0WUDJeEGMD8FWh8UyrI3aHNN6NT7l+/isSl3ico=" + [mod."github.com/yusufpapurcu/wmi"] + version = "v1.2.2" + hash = "sha256-Rno6F82JIeglBobQl6YKl3U6+FvWXmFavJlzpOJgoXI=" + [mod."gitlab.com/gomidi/midi/v2"] + version = "v2.0.25" + hash = "sha256-3oTPzuPX1hNd+6/5kRUcMfMztvQa2UWHPppp8OPiP90=" + [mod."golang.org/x/crypto"] + version = "v0.4.0" + hash = "sha256-PvHIbuooDItiNyQEi8kKgybkc0o95B0aeMd9awVGFCY=" + [mod."golang.org/x/exp"] + version = "v0.0.0-20221205204356-47842c84f3db" + hash = "sha256-HWHDTTbsKZp1bMN06ZKluiLt8Yfjtnf1XhR9GWp4rQk=" + [mod."golang.org/x/exp/shiny"] + version = "v0.0.0-20221126150942-6ab00d035af9" + hash = "sha256-+OAzuS+wyjOBSarGBuHjMeQV3vZzTbmF7CH8wnE7aA8=" + [mod."golang.org/x/image"] + version = "v0.3.0" + hash = "sha256-d6/w/CwI5GRGjuOGA7L7x4rEPfcHAVV3ZzsKxKmMYR4=" + [mod."golang.org/x/mobile"] + version = "v0.0.0-20201217150744-e6ae53a27f4f" + hash = "sha256-NdxlpSJhVpmE/T84HHoPtQ1GPCvDNkbNzNTYa5HEEYE=" + [mod."golang.org/x/mod"] + version = "v0.10.0" + hash = "sha256-g0T2wz+K0nhPWdVQJRGGqEqzlTHMBahv+9C3y090eIM=" + [mod."golang.org/x/net"] + version = "v0.10.0" + hash = "sha256-HkGiUYBZOBdOtt7mYo3N3swFjjAXzW++pG2JeWGJR9Q=" + [mod."golang.org/x/sys"] + version = "v0.8.0" + hash = "sha256-wLPPnoFkHM1HPUaFIfRyQZOJjrqXVZimB0nMySly7Xg=" + [mod."golang.org/x/text"] + version = "v0.9.0" + hash = "sha256-tkhDeMsSQZr3jo7vmKehWs3DvWetwXR0IB+DCLbQ4nk=" + [mod."golang.org/x/tools"] + version = "v0.9.1" + hash = "sha256-6jvh0cvdVMvGBceeBxWFj0+bFvboB8wuIYPHabxrST0=" + [mod."gopkg.in/check.v1"] + version = "v1.0.0-20201130134442-10cb98267c6c" + hash = "sha256-VlIpM2r/OD+kkyItn6vW35dyc0rtkJufA93rjFyzncs=" + [mod."gopkg.in/yaml.v3"] + version = "v3.0.1" + hash = "sha256-FqL9TKYJ0XkNwJFnq9j0VvJ5ZUU1RvH/52h/f5bkYAU=" + [mod."modernc.org/libc"] + version = "v1.21.5" + hash = "sha256-q2ZMb7TY1mp/Ia6e/I+44mrmpUBHErW4Q6/lPXpep28=" + [mod."modernc.org/mathutil"] + version = "v1.5.0" + hash = "sha256-5xM9HjjHf9sB0vLfN53PdGpT0qPF1+KI1/lgN0/4LQo=" + [mod."modernc.org/memory"] + version = "v1.4.0" + hash = "sha256-x78QWQ1H82eolL7JiG6eP6l4fHhRNyIlSryQKpibcBo=" + [mod."modernc.org/sqlite"] + version = "v1.20.0-with-win386" + hash = "sha256-ICV8xqeBvySJtmVV4DpqihUyRbXdaq11ba+UvMltFn8=" + replaced = "github.com/fumiama/sqlite3" diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000000..b7b1aabc2e --- /dev/null +++ b/shell.nix @@ -0,0 +1,23 @@ +{ + pkgs ? ( + let + inherit (builtins) fetchTree fromJSON readFile; + inherit ((fromJSON (readFile ./flake.lock)).nodes) nixpkgs gomod2nix; + in + import (fetchTree nixpkgs.locked) { + overlays = [ + (import "${fetchTree gomod2nix.locked}/overlay.nix") + ]; + } + ), + mkGoEnv ? pkgs.mkGoEnv, + gomod2nix ? pkgs.gomod2nix, +}: let + goEnv = mkGoEnv {pwd = ./.;}; +in + pkgs.mkShell { + packages = [ + goEnv + gomod2nix + ]; + }