@q78kg/koishi-plugin-text-censor 1.0.4-beta.6 → 1.0.4-beta.8

Sign up to get free protection for your applications and to get access to all the features.
package/lib/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Context, Schema } from 'koishi';
2
2
  export declare const name = "text-censor";
3
3
  export interface Config {
4
- textDatabase: [string, string][];
4
+ textDatabase: [string][];
5
5
  removeWords: boolean;
6
6
  transformToUpper: boolean;
7
7
  }
package/lib/index.js CHANGED
@@ -45,7 +45,6 @@ var Config = import_koishi.Schema.intersect([
45
45
  import_koishi.Schema.object({
46
46
  textDatabase: import_koishi.Schema.array(
47
47
  import_koishi.Schema.tuple([
48
- import_koishi.Schema.string().role("text"),
49
48
  import_koishi.Schema.string().default("data/text-censor/censor.txt")
50
49
  ])
51
50
  ).description("敏感词库的文件路径。").default([["", "data/text-censor/censor.txt"]])
@@ -60,7 +59,7 @@ var Config = import_koishi.Schema.intersect([
60
59
  ]);
61
60
  function apply(ctx, config) {
62
61
  let words = [];
63
- for (const [_, file] of config.textDatabase) {
62
+ for (const [file] of config.textDatabase) {
64
63
  const filePath = (0, import_node_path.resolve)(ctx.baseDir, file);
65
64
  if (!(0, import_node_fs.existsSync)(filePath)) {
66
65
  ctx.logger.warn(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@q78kg/koishi-plugin-text-censor",
3
3
  "description": "A text censor provider for Koishi",
4
- "version": "1.0.4-beta.6",
4
+ "version": "1.0.4-beta.8",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [