Commit 35c9ac23 authored by nanahira's avatar nanahira

fix connect

parent a85a73bc
Pipeline #6281 passed with stages
in 2 minutes and 6 seconds
{
"name": "koishi-plugin-ygocard",
"version": "1.0.2",
"version": "1.0.3",
"description": "Koishi Plugin for YGOPro card query",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
......@@ -59,6 +59,10 @@ export class MyPlugin {
this.ctx = ctx;
this.config = schemaTransform(YGOCardConfig, config);
await this.loadDBs();
ctx.on('connect', () => this.loadDBs());
ctx.on('disconnect', () => {
this.dbs.forEach((db) => db.close());
});
ctx
.command(
`${this.config.commandName} <cardQuery:string>`,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment