koishi-plugin-sy-bot 0.0.11 → 0.0.14
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/lib/index.js +3 -3
- package/package.json +3 -3
- package/readme.md +23 -2
package/lib/index.js
CHANGED
|
@@ -495,7 +495,7 @@ function registerBible(ctx, config) {
|
|
|
495
495
|
ctx.command("bible [index:number]", "圣经").action(async ({ session }, index) => {
|
|
496
496
|
const bibles = await ctx.database.get("bibles");
|
|
497
497
|
if (!index) {
|
|
498
|
-
return "======== 圣经列表 ========\n" + bibles.map((bible) => `${
|
|
498
|
+
return "======== 圣经列表 ========\n" + bibles.map((bible, idx) => `${idx} - 《${bible.title}》`).join("\n");
|
|
499
499
|
} else {
|
|
500
500
|
return bibles[index - 1] ? bibles[index - 1].content : "没有这个哦,喵~";
|
|
501
501
|
}
|
|
@@ -517,7 +517,7 @@ function registerResource(ctx, config) {
|
|
|
517
517
|
const resources = await ctx.database.get("resources");
|
|
518
518
|
if (!index) {
|
|
519
519
|
const top = "-------- 资源合集 \n----------------\n";
|
|
520
|
-
return top + resources.map((res) => `${
|
|
520
|
+
return top + resources.map((res, idx) => `${idx + 1} 《${res.title}》`).join(" \n");
|
|
521
521
|
} else {
|
|
522
522
|
return resources[index - 1] ? resources[index - 1].content : "没有这个哦,喵";
|
|
523
523
|
}
|
|
@@ -560,7 +560,7 @@ function registerTip(ctx, config) {
|
|
|
560
560
|
const tips = await ctx.database.get("tips");
|
|
561
561
|
if (!index) {
|
|
562
562
|
const top = "-------- 经验贴合集 \n----------------\n";
|
|
563
|
-
return top + tips.map((tip) => `${
|
|
563
|
+
return top + tips.map((tip, idx) => `${idx} 《${tip.title}》`).join(" \n");
|
|
564
564
|
} else {
|
|
565
565
|
return tips[index - 1] ? tips[index - 1].url : "没有这个哦,喵";
|
|
566
566
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koishi-plugin-sy-bot",
|
|
3
3
|
"description": "考研群答疑Bot,接入Gemini。",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.14",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"scripts": {
|
|
13
13
|
"dev": "cd ../.. && npm run dev",
|
|
14
|
-
"build": "
|
|
15
|
-
"v": "cd ../.. && npm run build && npm run bump",
|
|
14
|
+
"build": "echo '直接更新版本会自动编译!'",
|
|
15
|
+
"v": "cd ../.. && echo '构建中...' && npm run build && npm run bump",
|
|
16
16
|
"pub": "cd ../.. && npm run pub",
|
|
17
17
|
"login": "cd ../.. && npm login"
|
|
18
18
|
},
|
package/readme.md
CHANGED
|
@@ -2,8 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/koishi-plugin-sy-bot)
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
5
|
+
## 考研群多功能答疑机器人
|
|
7
6
|
|
|
8
7
|
Gemini API取自:[https://api.qingyuntop.top/](https://api.qingyuntop.top/)
|
|
9
8
|
|
|
9
|
+
## 使用方法
|
|
10
|
+
|
|
11
|
+
- 在配置中配置管理的考研群号、管理员群号
|
|
12
|
+
- 前往青云☁️API购买GeminiAPI
|
|
13
|
+
- 注意GeminiAPI必须为Gemini【分组】的API秘钥
|
|
14
|
+
- 使用提供的命令进行聊天
|
|
15
|
+
|
|
16
|
+
在群聊中调用`ask`命令来询问群机器人,bot会调用gemini进行回答,将回答结果的markdown文本渲染作为图片返回。
|
|
17
|
+
|
|
18
|
+
使用提示:
|
|
19
|
+
- 可以引用消息块后`ask`
|
|
20
|
+
- 引用块和输入块中的信息最终会被处理为一个整体作为机器人的输入
|
|
21
|
+
- 可以输入多张图片,bot会自动调用Gemini的图片理解API进行回答
|
|
22
|
+
- 如果只输入文本,bot会自动调用Gemini的文本对话API进行回答
|
|
23
|
+
|
|
24
|
+
额外功能:
|
|
25
|
+
- 可以在数据库中添加考研资料内容
|
|
26
|
+
- 通过命令`resource [数字]`来访问对应的资源
|
|
27
|
+
- 通过命令`bible [数字]`来访问对应的`考研圣经`
|
|
28
|
+
- 通过`tip [数字]`来访问对应的考研经验贴
|
|
29
|
+
- 数字为可选参数,如果留空则会输出资源列表
|
|
30
|
+
- 通过命令`countdown`可以显示当前距离27考研的精确倒计时
|