koishi-plugin-blacklist-online 0.1.0 → 0.1.1
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.d.ts +1 -1
- package/lib/index.js +6 -5
- package/lib/types.d.ts +3 -2
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import { Context, Schema } from 'koishi';
|
|
|
2
2
|
import { PluginConfig } from './types';
|
|
3
3
|
export declare const name = "blacklist-online";
|
|
4
4
|
export declare const inject: string[];
|
|
5
|
-
export declare const usage = "\n## \u529F\u80FD\u8BF4\u660E\n\u4E00\u4E2A\u5F3A\u5927\u7684\u3001\u57FA\u4E8E\u6570\u636E\u5E93\u7684\u7FA4\u7EC4\u9ED1\u540D\u5355\u7BA1\u7406\u63D2\u4EF6\u3002\n- **\
|
|
5
|
+
export declare const usage = "\n## \u529F\u80FD\u8BF4\u660E\n\u4E00\u4E2A\u5F3A\u5927\u7684\u3001\u57FA\u4E8E\u6570\u636E\u5E93\u7684\u7FA4\u7EC4\u9ED1\u540D\u5355\u7BA1\u7406\u63D2\u4EF6\u3002\n- **\u53D7\u4FDD\u62A4\u540D\u5355**: \u914D\u7F6E\u4E2D\u7684\u7528\u6237\u65E0\u6CD5\u88AB\u62C9\u9ED1\u3002\n- **\u5206\u7FA4\u7BA1\u7406**: \u53EF\u4E3A\u6BCF\u4E2A\u7FA4\u72EC\u7ACB\u8BBE\u7F6E\u9ED1\u540D\u5355\u5904\u7406\u6A21\u5F0F\u3002\n- **\u5165\u7FA4\u626B\u63CF**: \u53EF\u914D\u7F6E\u673A\u5668\u4EBA\u5728\u52A0\u5165\u65B0\u7FA4\u7EC4\u65F6\uFF0C\u81EA\u52A8\u626B\u63CF\u7FA4\u5185\u73B0\u6709\u6210\u5458\u3002\n- **\u81EA\u52A8\u62D2\u7EDD**: \u81EA\u52A8\u62D2\u7EDD\u6570\u636E\u5E93\u9ED1\u540D\u5355\u7528\u6237\u7684\u52A0\u7FA4\u7533\u8BF7\u3002\n- **\u624B\u52A8\u626B\u63CF**: \u63D0\u4F9B\u6307\u4EE4\u624B\u52A8\u626B\u63CF\u5F53\u524D\u6216\u5168\u90E8\u7FA4\u7EC4\u3002\n- **\u6743\u9650\u63A7\u5236**: \u6240\u6709\u6307\u4EE4\u5747\u6709\u6743\u9650\u7B49\u7EA7\u63A7\u5236\u3002\n";
|
|
6
6
|
export declare const Config: Schema<PluginConfig>;
|
|
7
7
|
export declare function apply(ctx: Context, config: PluginConfig): void;
|
package/lib/index.js
CHANGED
|
@@ -10,13 +10,9 @@ exports.inject = ['database', 'http'];
|
|
|
10
10
|
exports.usage = `
|
|
11
11
|
## 功能说明
|
|
12
12
|
一个强大的、基于数据库的群组黑名单管理插件。
|
|
13
|
-
- **数据库驱动**: QQ号黑名单存储在数据库中,可通过指令动态增删,支持操作追溯。
|
|
14
13
|
- **受保护名单**: 配置中的用户无法被拉黑。
|
|
15
|
-
- **申请/审批流程**: 普通群管理可提交拉黑申请,由机器人管理员审批,所有流程自动化通知。
|
|
16
14
|
- **分群管理**: 可为每个群独立设置黑名单处理模式。
|
|
17
|
-
- **昵称黑名单**: 支持配置静态的昵称关键词黑名单,并有总开关控制。
|
|
18
15
|
- **入群扫描**: 可配置机器人在加入新群组时,自动扫描群内现有成员。
|
|
19
|
-
- **延迟检查**: 新成员加入后,可配置延迟及周期性昵称检查,防止其修改昵称绕过检测。
|
|
20
16
|
- **自动拒绝**: 自动拒绝数据库黑名单用户的加群申请。
|
|
21
17
|
- **手动扫描**: 提供指令手动扫描当前或全部群组。
|
|
22
18
|
- **权限控制**: 所有指令均有权限等级控制。
|
|
@@ -54,7 +50,12 @@ function apply(ctx, config) {
|
|
|
54
50
|
const logger = ctx.logger('blacklist-online');
|
|
55
51
|
// 1. 扩展数据库
|
|
56
52
|
ctx.model.extend('blacklist_users', {
|
|
57
|
-
userId: 'string',
|
|
53
|
+
userId: 'string',
|
|
54
|
+
reason: 'string',
|
|
55
|
+
disabled: { type: 'boolean', initial: false },
|
|
56
|
+
operator_id: 'string',
|
|
57
|
+
source_id: 'string',
|
|
58
|
+
updated_at: 'timestamp'
|
|
58
59
|
}, { primary: 'userId' });
|
|
59
60
|
ctx.model.extend('blacklist_request_queue', {
|
|
60
61
|
id: 'string', type: 'string', payload: 'json', createdAt: 'timestamp', retryCount: 'unsigned'
|
package/lib/types.d.ts
CHANGED
|
@@ -18,9 +18,10 @@ export interface PluginConfig {
|
|
|
18
18
|
export interface BlacklistEntry {
|
|
19
19
|
userId: string;
|
|
20
20
|
reason: string;
|
|
21
|
-
|
|
21
|
+
operator_id?: string;
|
|
22
|
+
source_id?: string;
|
|
22
23
|
disabled: boolean;
|
|
23
|
-
|
|
24
|
+
updated_at: Date;
|
|
24
25
|
}
|
|
25
26
|
export interface OfflineRequest {
|
|
26
27
|
id: string;
|