koishi-plugin-tmp-application-change 1.0.1 → 1.0.2
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 -6
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -36,16 +36,13 @@ var Config = import_koishi.Schema.object({
|
|
|
36
36
|
});
|
|
37
37
|
var logger = new import_koishi2.Logger("tmp-application-change");
|
|
38
38
|
function apply(ctx, config) {
|
|
39
|
-
ctx.middleware((session, next) => {
|
|
40
|
-
if (!config.allowedGroups.includes(session.channelId.toString())) {
|
|
41
|
-
return session.send("此群无权限使用此指令");
|
|
42
|
-
}
|
|
43
|
-
return next();
|
|
44
|
-
});
|
|
45
39
|
ctx.command("vtc申请 <recruitment_id:string> <status:string> [reason:string]", "VTC申请审批", {
|
|
46
40
|
authority: 1
|
|
47
41
|
}).action(async ({ session }, recruitmentId, status, reason) => {
|
|
48
42
|
try {
|
|
43
|
+
if (!config.allowedGroups.includes(session.channelId.toString())) {
|
|
44
|
+
return "此群无权限使用此指令";
|
|
45
|
+
}
|
|
49
46
|
if (!recruitmentId || !status) {
|
|
50
47
|
return "请提供完整的参数:recruitment_id 和 status";
|
|
51
48
|
}
|