mioku-plugin-admin 2.3.3 → 2.3.4
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/package.json +11 -1
- package/skills/group.ts +18 -11
- package/skills/personal.ts +3 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mioku-plugin-admin",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.4",
|
|
4
4
|
"description": "管理插件,提供事件通知与群管/个人管理指令",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -137,6 +137,10 @@
|
|
|
137
137
|
{
|
|
138
138
|
"id": "/重新验证",
|
|
139
139
|
"match": "/^[/#]重新验证/"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"id": "/入群提示",
|
|
143
|
+
"match": "/^[/#]入群提示/"
|
|
140
144
|
}
|
|
141
145
|
],
|
|
142
146
|
"help": {
|
|
@@ -288,6 +292,12 @@
|
|
|
288
292
|
"desc": "让指定成员重新进行入群验证",
|
|
289
293
|
"usage": "/重新验证 @成员",
|
|
290
294
|
"role": "admin"
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"cmd": "/入群提示",
|
|
298
|
+
"desc": "设置本群自定义入群提示,可附带文字+图片",
|
|
299
|
+
"usage": "/入群提示 xxx;/入群提示 关闭",
|
|
300
|
+
"role": "admin"
|
|
291
301
|
}
|
|
292
302
|
]
|
|
293
303
|
}
|
package/skills/group.ts
CHANGED
|
@@ -61,14 +61,14 @@ const groupAdminSkill: AISkill = {
|
|
|
61
61
|
tools: [
|
|
62
62
|
{
|
|
63
63
|
name: "manage_member",
|
|
64
|
-
description:
|
|
65
|
-
"管理群成员:踢人(kick)、禁言(mute)、解除禁言(unmute)、设为管理员(set_admin)、取消管理员(unset_admin)、设置某成员头衔(set_title)、设置自己头衔(set_self_title)。",
|
|
64
|
+
description: "管理群成员",
|
|
66
65
|
parameters: {
|
|
67
66
|
type: "object",
|
|
68
67
|
properties: {
|
|
69
68
|
action: {
|
|
70
69
|
type: "string",
|
|
71
|
-
description:
|
|
70
|
+
description:
|
|
71
|
+
"要执行的动作:踢人,禁言,解禁,设置/取消管理,设置头衔",
|
|
72
72
|
enum: [
|
|
73
73
|
"kick",
|
|
74
74
|
"mute",
|
|
@@ -81,8 +81,7 @@ const groupAdminSkill: AISkill = {
|
|
|
81
81
|
},
|
|
82
82
|
user_id: {
|
|
83
83
|
type: "number",
|
|
84
|
-
description:
|
|
85
|
-
"目标成员QQ号。set_self_title 不需要;其他动作必填。",
|
|
84
|
+
description: "目标成员QQ号。set_self_title 不需要;其他动作必填",
|
|
86
85
|
},
|
|
87
86
|
duration: {
|
|
88
87
|
type: "number",
|
|
@@ -192,7 +191,11 @@ const groupAdminSkill: AISkill = {
|
|
|
192
191
|
return { error: `未知的 action: ${action}` };
|
|
193
192
|
}
|
|
194
193
|
} catch (err) {
|
|
195
|
-
logAdminSkillError(
|
|
194
|
+
logAdminSkillError(
|
|
195
|
+
runtimeCtx,
|
|
196
|
+
`admin_group.manage_member.${action}`,
|
|
197
|
+
err,
|
|
198
|
+
);
|
|
196
199
|
return { error: `执行 ${action} 失败: ${err}` };
|
|
197
200
|
}
|
|
198
201
|
},
|
|
@@ -200,7 +203,7 @@ const groupAdminSkill: AISkill = {
|
|
|
200
203
|
{
|
|
201
204
|
name: "manage_group",
|
|
202
205
|
description:
|
|
203
|
-
"
|
|
206
|
+
"管理群本身或批量撤回消息:开启/关闭全体禁言、改群名、改Bot在群里的名片、改群头像、撤回一条或多条消息",
|
|
204
207
|
parameters: {
|
|
205
208
|
type: "object",
|
|
206
209
|
properties: {
|
|
@@ -226,8 +229,7 @@ const groupAdminSkill: AISkill = {
|
|
|
226
229
|
},
|
|
227
230
|
message_id: {
|
|
228
231
|
type: "number",
|
|
229
|
-
description:
|
|
230
|
-
"包含图片的消息 message_id,仅 set_group_avatar 需要",
|
|
232
|
+
description: "包含图片的消息 message_id,仅 set_group_avatar 需要",
|
|
231
233
|
},
|
|
232
234
|
message_ids: {
|
|
233
235
|
type: "array",
|
|
@@ -260,7 +262,8 @@ const groupAdminSkill: AISkill = {
|
|
|
260
262
|
return { success: true, message: "当前群已关闭全体禁言" };
|
|
261
263
|
case "set_group_name": {
|
|
262
264
|
const groupName = String(args?.group_name || "").trim();
|
|
263
|
-
if (!groupName)
|
|
265
|
+
if (!groupName)
|
|
266
|
+
return { error: "set_group_name 需要提供 group_name" };
|
|
264
267
|
await bot.api("set_group_name", {
|
|
265
268
|
group_id: groupId,
|
|
266
269
|
group_name: groupName,
|
|
@@ -331,7 +334,11 @@ const groupAdminSkill: AISkill = {
|
|
|
331
334
|
return { error: `未知的 action: ${action}` };
|
|
332
335
|
}
|
|
333
336
|
} catch (err) {
|
|
334
|
-
logAdminSkillError(
|
|
337
|
+
logAdminSkillError(
|
|
338
|
+
runtimeCtx,
|
|
339
|
+
`admin_group.manage_group.${action}`,
|
|
340
|
+
err,
|
|
341
|
+
);
|
|
335
342
|
return { error: `执行 ${action} 失败: ${err}` };
|
|
336
343
|
}
|
|
337
344
|
},
|
package/skills/personal.ts
CHANGED
|
@@ -21,13 +21,13 @@ function logAdminSkillError(runtimeCtx: any, toolName: string, err: unknown) {
|
|
|
21
21
|
const personalSkill: AISkill = {
|
|
22
22
|
name: "admin_personal",
|
|
23
23
|
description:
|
|
24
|
-
"Bot
|
|
24
|
+
"Bot个人账号与消息管理统一入口:修改Bot资料、发送消息、获取列表、管理关系",
|
|
25
25
|
permission: "owner",
|
|
26
26
|
tools: [
|
|
27
27
|
{
|
|
28
28
|
name: "manage_personal",
|
|
29
29
|
description:
|
|
30
|
-
"Bot
|
|
30
|
+
"Bot个人账号管理:修改头像/昵称/签名/性别、给指定用户或群发消息、查看好友/群列表、删除好友、退群",
|
|
31
31
|
parameters: {
|
|
32
32
|
type: "object",
|
|
33
33
|
properties: {
|
|
@@ -66,8 +66,7 @@ const personalSkill: AISkill = {
|
|
|
66
66
|
},
|
|
67
67
|
user_id: {
|
|
68
68
|
type: "number",
|
|
69
|
-
description:
|
|
70
|
-
"目标QQ号。send_private / delete_friend 需要。",
|
|
69
|
+
description: "目标QQ号。send_private / delete_friend 需要。",
|
|
71
70
|
},
|
|
72
71
|
group_id: {
|
|
73
72
|
type: "number",
|