koishi-plugin-gl-bot 0.0.7 → 0.0.8

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 ADDED
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Config = exports.name = void 0;
4
+ exports.apply = apply;
5
+ const koishi_1 = require("koishi");
6
+ const path_1 = require("path");
7
+ exports.name = "gl-bot";
8
+ exports.Config = koishi_1.Schema.object({});
9
+ function apply(ctx) {
10
+ ctx.inject(["console"], (ctx) => {
11
+ ctx.on("message", (session) => {
12
+ console.log(session.content);
13
+ if (session.content === "天王盖地虎1") {
14
+ session.send("宝塔镇河妖");
15
+ }
16
+ });
17
+ ctx.console.addEntry({
18
+ dev: (0, path_1.resolve)(__dirname, "../client/index.ts"),
19
+ prod: (0, path_1.resolve)(__dirname, "../lib"),
20
+ });
21
+ });
22
+ }
package/package.json CHANGED
@@ -1,17 +1,18 @@
1
1
  {
2
2
  "name": "koishi-plugin-gl-bot",
3
3
  "description": "GleamSlime Koishi Rebot Plugins",
4
- "version": "0.0.7",
5
- "main": "src/index.ts",
4
+ "version": "0.0.8",
5
+ "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "contributors": [
8
8
  "GleamSlime <gleamslime@163.com>"
9
9
  ],
10
10
  "scripts": {
11
- "build": "tsc -p ."
11
+ "format": "prettier --write .",
12
+ "lint": "eslint .",
13
+ "fl": "prettier --write . && eslint . --fix"
12
14
  },
13
15
  "files": [
14
- "src",
15
16
  "lib",
16
17
  "dist"
17
18
  ],
package/lib/index.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import { Context, Schema } from "koishi";
2
- export declare const name = "gl-bot";
3
- export interface Config {
4
- }
5
- export declare const Config: Schema<Config>;
6
- export declare function apply(ctx: Context): void;
package/src/index.ts DELETED
@@ -1,20 +0,0 @@
1
- import { Context, Schema } from "koishi";
2
- import { resolve } from "path";
3
- import {} from "@koishijs/plugin-console";
4
-
5
- export const name = "gl-bot";
6
-
7
- export interface Config {}
8
-
9
- export const Config: Schema<Config> = Schema.object({});
10
-
11
- export function apply(ctx: Context) {
12
- ctx.inject(["console"], (ctx) => {
13
- ctx.on("message", (session) => {
14
- console.log(session.content);
15
- if (session.content === "天王盖地虎") {
16
- session.send("宝塔镇河妖");
17
- }
18
- });
19
- });
20
- }