Commit 7c326fce authored by nanahira's avatar nanahira

fix

parent 1467da1c
...@@ -26,6 +26,10 @@ app.plugin(DatabasePlugin); ...@@ -26,6 +26,10 @@ app.plugin(DatabasePlugin);
app.plugin(ExtrasInDev); app.plugin(ExtrasInDev);
// Target plugin // Target plugin
app.plugin(TargetPlugin, {} as any); app.plugin(TargetPlugin, {
targetGuilds: ['#'],
publishers: ['Bob'],
masterId: 'Alice',
});
app.start(); app.start();
...@@ -15,7 +15,6 @@ import { ...@@ -15,7 +15,6 @@ import {
UsePlugin, UsePlugin,
PluginDef, PluginDef,
OnPrivate, OnPrivate,
Reusable,
Provide, Provide,
} from 'koishi-thirdeye'; } from 'koishi-thirdeye';
export * from './config'; export * from './config';
...@@ -48,18 +47,18 @@ class Utility extends base { ...@@ -48,18 +47,18 @@ class Utility extends base {
@DefinePlugin() @DefinePlugin()
class ControlPanel extends base { class ControlPanel extends base {
@Inject() @Inject(true)
private uitlity: Utility; private utility: Utility;
@UseCommand('order', '抢单管理', { empty: true }) @UseCommand('order', '抢单管理', { empty: true })
orderCommand() {} orderCommand() {}
private async switch(selfId: string, online: boolean, desc: string) { private async switch(selfId: string, online: boolean, desc: string) {
const currentStatus = await this.uitlity.isOnline(selfId); const currentStatus = await this.utility.isOnline(selfId);
if (currentStatus === online) { if (currentStatus === online) {
return `我已经在${desc}了。`; return `我已经在${desc}了。`;
} }
await this.uitlity.setOnline(selfId, online); await this.utility.setOnline(selfId, online);
return `${desc}成功。`; return `${desc}成功。`;
} }
...@@ -75,7 +74,7 @@ class ControlPanel extends base { ...@@ -75,7 +74,7 @@ class ControlPanel extends base {
@UseCommand('order.status', '查看上班状态') @UseCommand('order.status', '查看上班状态')
async status(@PutSelfId() id: string) { async status(@PutSelfId() id: string) {
const online = await this.uitlity.isOnline(id); const online = await this.utility.isOnline(id);
return `我${online ? '上班' : '下班'}了。`; return `我${online ? '上班' : '下班'}了。`;
} }
} }
......
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