koishi-plugin-group-verification 1.0.11 → 1.0.12
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 +47 -6
- package/package.json +1 -1
- package/src/index.ts +27 -6
package/lib/index.js
CHANGED
|
@@ -251,7 +251,15 @@ ${debugInfo}`];
|
|
|
251
251
|
}
|
|
252
252
|
__name(checkPermission, "checkPermission");
|
|
253
253
|
const groupVerify = ctx.command("group-verify", "群组验证管理命令").alias("gv", "gverify");
|
|
254
|
-
groupVerify.subcommand(".config [keywords:text]", "配置群组验证规则").alias(
|
|
254
|
+
groupVerify.subcommand(".config [keywords:text]", "配置群组验证规则").alias(
|
|
255
|
+
"gv.cfg",
|
|
256
|
+
"gverify.cfg",
|
|
257
|
+
"group-verify.cfg",
|
|
258
|
+
"gv.配置",
|
|
259
|
+
"gverify.配置",
|
|
260
|
+
"group-verify.配置",
|
|
261
|
+
"gvc"
|
|
262
|
+
).option("groupId", "-i <groupId> 指定群号").option("method", "-m <method> 审核方式 (0-3)").option("threshold", "-t <threshold> 阈值参数").option("message", "-msg <message> 自定义提醒消息").option("query", "-? 查询当前配置").option("remove", "-r 删除配置").action(async ({ session, options }, keywords) => {
|
|
255
263
|
const targetGroupId = options.groupId || session.guildId;
|
|
256
264
|
const [hasPermission, errorMsg] = await checkPermission(session, targetGroupId);
|
|
257
265
|
if (!hasPermission) {
|
|
@@ -373,7 +381,15 @@ ${debugInfo}`];
|
|
|
373
381
|
return `已为群 ${targetGroupId} 创建验证配置`;
|
|
374
382
|
}
|
|
375
383
|
});
|
|
376
|
-
groupVerify.subcommand(".approve [userId]", "同意加群申请").alias(
|
|
384
|
+
groupVerify.subcommand(".approve [userId]", "同意加群申请").alias(
|
|
385
|
+
"gv.accept",
|
|
386
|
+
"gverify.accept",
|
|
387
|
+
"group-verify.accept",
|
|
388
|
+
"gv.同意",
|
|
389
|
+
"gverify.同意",
|
|
390
|
+
"group-verify.同意",
|
|
391
|
+
"gva"
|
|
392
|
+
).action(async ({ session }, userId) => {
|
|
377
393
|
const [hasPermission, errorMsg] = await checkPermission(session);
|
|
378
394
|
if (!hasPermission) {
|
|
379
395
|
return errorMsg || "权限不足";
|
|
@@ -432,7 +448,15 @@ ${debugInfo}`];
|
|
|
432
448
|
return `处理申请时出错: ${error.message}`;
|
|
433
449
|
}
|
|
434
450
|
});
|
|
435
|
-
groupVerify.subcommand(".reject [userId]", "拒绝加群申请").alias(
|
|
451
|
+
groupVerify.subcommand(".reject [userId]", "拒绝加群申请").alias(
|
|
452
|
+
"gv.拒绝",
|
|
453
|
+
"gverify.拒绝",
|
|
454
|
+
"group-verify.拒绝",
|
|
455
|
+
"gv.rej",
|
|
456
|
+
"gverify.rej",
|
|
457
|
+
"group-verify.rej",
|
|
458
|
+
"gvr"
|
|
459
|
+
).action(async ({ session }, userId) => {
|
|
436
460
|
const [hasPermission, errorMsg] = await checkPermission(session);
|
|
437
461
|
if (!hasPermission) {
|
|
438
462
|
return errorMsg || "权限不足";
|
|
@@ -489,7 +513,12 @@ ${debugInfo}`];
|
|
|
489
513
|
return `处理申请时出错: ${error.message}`;
|
|
490
514
|
}
|
|
491
515
|
});
|
|
492
|
-
groupVerify.subcommand(".stats [target]", "查看群组验证统计信息").alias(
|
|
516
|
+
groupVerify.subcommand(".stats [target]", "查看群组验证统计信息").alias(
|
|
517
|
+
"gv.统计",
|
|
518
|
+
"gverify.统计",
|
|
519
|
+
"group-verify.统计",
|
|
520
|
+
"gvs"
|
|
521
|
+
).action(async ({ session }, target) => {
|
|
493
522
|
const validTargets = ["all", "total"];
|
|
494
523
|
const isGroupId = target && /^\d+$/.test(target);
|
|
495
524
|
const isSpecialTarget = target && validTargets.includes(target.toLowerCase());
|
|
@@ -517,7 +546,15 @@ ${debugInfo}`];
|
|
|
517
546
|
}
|
|
518
547
|
return "参数错误";
|
|
519
548
|
});
|
|
520
|
-
groupVerify.subcommand(".pending", "查看待审核加群申请").alias(
|
|
549
|
+
groupVerify.subcommand(".pending", "查看待审核加群申请").alias(
|
|
550
|
+
"gv.list",
|
|
551
|
+
"gverify.list",
|
|
552
|
+
"group-verify.list",
|
|
553
|
+
"gv.待处理",
|
|
554
|
+
"gverify.待处理",
|
|
555
|
+
"group-verify.待处理",
|
|
556
|
+
"gvp"
|
|
557
|
+
).action(async ({ session }) => {
|
|
521
558
|
if (!session.guildId) {
|
|
522
559
|
return "请在群聊中使用此命令";
|
|
523
560
|
}
|
|
@@ -537,7 +574,11 @@ ${debugInfo}`];
|
|
|
537
574
|
});
|
|
538
575
|
return result;
|
|
539
576
|
});
|
|
540
|
-
groupVerify.subcommand(".help", "显示帮助信息").alias(
|
|
577
|
+
groupVerify.subcommand(".help", "显示帮助信息").alias(
|
|
578
|
+
"gv.帮助",
|
|
579
|
+
"gverify.帮助",
|
|
580
|
+
"group-verify.帮助"
|
|
581
|
+
).action(() => {
|
|
541
582
|
return `群组验证命令帮助:
|
|
542
583
|
主指令别名:gv, gverify
|
|
543
584
|
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -371,7 +371,11 @@ export function apply(ctx: Context, config: Config) {
|
|
|
371
371
|
// Subcommand: configure group verification
|
|
372
372
|
groupVerify
|
|
373
373
|
.subcommand('.config [keywords:text]', '配置群组验证规则')
|
|
374
|
-
.alias(
|
|
374
|
+
.alias(
|
|
375
|
+
'gv.cfg', 'gverify.cfg', 'group-verify.cfg',
|
|
376
|
+
'gv.配置', 'gverify.配置', 'group-verify.配置',
|
|
377
|
+
'gvc'
|
|
378
|
+
)
|
|
375
379
|
.option('groupId', '-i <groupId> 指定群号')
|
|
376
380
|
.option('method', '-m <method> 审核方式 (0-3)')
|
|
377
381
|
.option('threshold', '-t <threshold> 阈值参数')
|
|
@@ -537,7 +541,11 @@ export function apply(ctx: Context, config: Config) {
|
|
|
537
541
|
// Subcommand: approve join request
|
|
538
542
|
groupVerify
|
|
539
543
|
.subcommand('.approve [userId]', '同意加群申请')
|
|
540
|
-
.alias(
|
|
544
|
+
.alias(
|
|
545
|
+
'gv.accept', 'gverify.accept', 'group-verify.accept',
|
|
546
|
+
'gv.同意', 'gverify.同意', 'group-verify.同意',
|
|
547
|
+
'gva'
|
|
548
|
+
)
|
|
541
549
|
.action(async ({ session }, userId) => {
|
|
542
550
|
// 权限检查
|
|
543
551
|
const [hasPermission, errorMsg] = await checkPermission(session)
|
|
@@ -618,7 +626,11 @@ export function apply(ctx: Context, config: Config) {
|
|
|
618
626
|
// Subcommand: reject join request
|
|
619
627
|
groupVerify
|
|
620
628
|
.subcommand('.reject [userId]', '拒绝加群申请')
|
|
621
|
-
.alias(
|
|
629
|
+
.alias(
|
|
630
|
+
'gv.拒绝', 'gverify.拒绝', 'group-verify.拒绝',
|
|
631
|
+
'gv.rej', 'gverify.rej', 'group-verify.rej',
|
|
632
|
+
'gvr'
|
|
633
|
+
)
|
|
622
634
|
.action(async ({ session }, userId) => {
|
|
623
635
|
// 权限检查
|
|
624
636
|
const [hasPermission, errorMsg] = await checkPermission(session)
|
|
@@ -699,7 +711,10 @@ export function apply(ctx: Context, config: Config) {
|
|
|
699
711
|
// Subcommand: view statistics
|
|
700
712
|
groupVerify
|
|
701
713
|
.subcommand('.stats [target]', '查看群组验证统计信息')
|
|
702
|
-
.alias(
|
|
714
|
+
.alias(
|
|
715
|
+
'gv.统计', 'gverify.统计', 'group-verify.统计',
|
|
716
|
+
'gvs'
|
|
717
|
+
)
|
|
703
718
|
.action(async ({ session }, target) => {
|
|
704
719
|
// 参数验证:只能是群号、all、total或空
|
|
705
720
|
const validTargets = ['all', 'total']
|
|
@@ -746,7 +761,11 @@ export function apply(ctx: Context, config: Config) {
|
|
|
746
761
|
// Subcommand: view pending requests
|
|
747
762
|
groupVerify
|
|
748
763
|
.subcommand('.pending', '查看待审核加群申请')
|
|
749
|
-
.alias(
|
|
764
|
+
.alias(
|
|
765
|
+
'gv.list', 'gverify.list', 'group-verify.list',
|
|
766
|
+
'gv.待处理', 'gverify.待处理', 'group-verify.待处理',
|
|
767
|
+
'gvp'
|
|
768
|
+
)
|
|
750
769
|
.action(async ({ session }) => {
|
|
751
770
|
if (!session.guildId) {
|
|
752
771
|
return '请在群聊中使用此命令'
|
|
@@ -775,7 +794,9 @@ export function apply(ctx: Context, config: Config) {
|
|
|
775
794
|
// Subcommand: help information
|
|
776
795
|
groupVerify
|
|
777
796
|
.subcommand('.help', '显示帮助信息')
|
|
778
|
-
.alias(
|
|
797
|
+
.alias(
|
|
798
|
+
'gv.帮助', 'gverify.帮助', 'group-verify.帮助'
|
|
799
|
+
)
|
|
779
800
|
.action(() => {
|
|
780
801
|
return `群组验证命令帮助:
|
|
781
802
|
主指令别名:gv, gverify
|