@azimiao/koishi-plugin-cafe-bot-exp 0.0.23 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/lib/index.js +15 -11
- package/lib/quiz/index.d.ts +1 -1
- package/package.json +2 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019-present Azimiao
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/lib/index.js
CHANGED
|
@@ -39,7 +39,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
39
39
|
var import_url = require("url");
|
|
40
40
|
|
|
41
41
|
// package.json
|
|
42
|
-
var version = "0.0.
|
|
42
|
+
var version = "0.0.26";
|
|
43
43
|
|
|
44
44
|
// src/index.ts
|
|
45
45
|
var fs4 = __toESM(require("fs/promises"));
|
|
@@ -703,8 +703,8 @@ async function apply3(ctx, config) {
|
|
|
703
703
|
wrong: "integer"
|
|
704
704
|
}, { primary: "id", autoInc: true });
|
|
705
705
|
await downloadQuitDataIfNotExist(ctx, config, config.forceUpdateWhenLoad);
|
|
706
|
-
ctx.command("
|
|
707
|
-
ctx.command("
|
|
706
|
+
ctx.command("轨迹问答", "证明自己是合格的桂皮吧~");
|
|
707
|
+
ctx.command("轨迹问答/出题", "随机抽一道题目").action(async (argv, _) => {
|
|
708
708
|
await downloadQuitDataIfNotExist(ctx, config, false);
|
|
709
709
|
var lastQuestion = await ctx.cache.get("question", argv.session.userId);
|
|
710
710
|
if (lastQuestion) {
|
|
@@ -749,27 +749,27 @@ D. ${qOptions[3].s}`;
|
|
|
749
749
|
await argv.session?.send(messageQuestion);
|
|
750
750
|
return;
|
|
751
751
|
});
|
|
752
|
-
ctx.command("
|
|
752
|
+
ctx.command("轨迹问答/回答 <answer:text>", `使用"回答+空格+选项"回答问题,另外你也可以直接@我说出选项(ABCD)哦`).action(async (argv, answer) => {
|
|
753
753
|
await answerHandler(ctx, config, argv, answer);
|
|
754
754
|
return;
|
|
755
755
|
});
|
|
756
|
-
ctx.command("
|
|
756
|
+
ctx.command("轨迹问答/A", "选择 A 选项", { hidden: true }).action(async (argv, _) => {
|
|
757
757
|
await answerHandler(ctx, config, argv, "A");
|
|
758
758
|
return;
|
|
759
759
|
});
|
|
760
|
-
ctx.command("
|
|
760
|
+
ctx.command("轨迹问答/B", "选择 B 选项", { hidden: true }).action(async (argv, _) => {
|
|
761
761
|
await answerHandler(ctx, config, argv, "B");
|
|
762
762
|
return;
|
|
763
763
|
});
|
|
764
|
-
ctx.command("
|
|
764
|
+
ctx.command("轨迹问答/C", "选择 C 选项", { hidden: true }).action(async (argv, _) => {
|
|
765
765
|
await answerHandler(ctx, config, argv, "C");
|
|
766
766
|
return;
|
|
767
767
|
});
|
|
768
|
-
ctx.command("
|
|
768
|
+
ctx.command("轨迹问答/D", "选择 D 选项", { hidden: true }).action(async (argv, _) => {
|
|
769
769
|
await answerHandler(ctx, config, argv, "D");
|
|
770
770
|
return;
|
|
771
771
|
});
|
|
772
|
-
ctx.command("
|
|
772
|
+
ctx.command("轨迹问答/答题分", "查看答题总分数").action(async (argv, _) => {
|
|
773
773
|
const userQuiz = await ctx.database.get("cafeQuiz", { userId: argv.session.userId });
|
|
774
774
|
if (userQuiz.length === 0) {
|
|
775
775
|
await argv.session?.send(`${At(argv)}你还没有答过题哦,快来答题吧~`);
|
|
@@ -807,8 +807,8 @@ var import_koishi7 = require("koishi");
|
|
|
807
807
|
var Config4 = import_koishi7.Schema.intersect([
|
|
808
808
|
import_koishi7.Schema.object({
|
|
809
809
|
logoUrl: import_koishi7.Schema.string().description("LOGO图片").default("https://www.azimiao.com/wp-content/uploads/2025/05/cafe-wide.jpg"),
|
|
810
|
-
refreshLogoWhenLoad: import_koishi7.Schema.boolean().description("每次加载插件强制刷新
|
|
811
|
-
useLocalLogoFile: import_koishi7.Schema.boolean().description("使用本地存储的
|
|
810
|
+
refreshLogoWhenLoad: import_koishi7.Schema.boolean().description("每次加载插件强制刷新 LOGO 图片").default(false),
|
|
811
|
+
useLocalLogoFile: import_koishi7.Schema.boolean().description("使用本地存储的 LOGO 图片(目前 QQ 平台不可用)").default(false)
|
|
812
812
|
}),
|
|
813
813
|
CafeBotDrawConfig.collapse(),
|
|
814
814
|
CafeBotQuizConfig.collapse(),
|
|
@@ -833,6 +833,10 @@ async function apply4(ctx, config) {
|
|
|
833
833
|
logoFilePath = path3.join(root, "logo.jpg");
|
|
834
834
|
logger3?.info(`Try check logoFile ${logoFilePath} or download it, forceUpdate:${config.refreshLogoWhenLoad}`);
|
|
835
835
|
var result = await downloadTool_default(ctx.http, config.logoUrl, logoFilePath, config.refreshLogoWhenLoad);
|
|
836
|
+
var a = "/koishi/data/cafe-bot-exp-data/logo.jpg";
|
|
837
|
+
var b = (0, import_url.pathToFileURL)(a);
|
|
838
|
+
console.log(b.href);
|
|
839
|
+
console.log(await ctx.http.isLocal(b.href));
|
|
836
840
|
logger3?.info(`download file ${result ? "ok" : "failed"}`);
|
|
837
841
|
ctx.command("关于", "关于本机器人的信息").action(async (argv, _) => {
|
|
838
842
|
argv.session?.send(
|
package/lib/quiz/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azimiao/koishi-plugin-cafe-bot-exp",
|
|
3
3
|
"description": "cafe bot experiment",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.26",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"repository": {
|
|
@@ -46,4 +46,4 @@
|
|
|
46
46
|
"@stdlib/random-base-uniform": "^0.2.1",
|
|
47
47
|
"fs.promises.exists": "^1.1.4"
|
|
48
48
|
}
|
|
49
|
-
}
|
|
49
|
+
}
|