Commit 7c326fce authored by nanahira's avatar nanahira

fix

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