diff --git a/src/plugins/BotControl.ts b/src/plugins/BotControl.ts index de60cd7d..2345438e 100644 --- a/src/plugins/BotControl.ts +++ b/src/plugins/BotControl.ts @@ -46,11 +46,7 @@ export class BotControlPlugin extends GlobalZeppelinPlugin { } protected getMemberLevel(member) { - if (this.getConfig().owners.includes(member.id)) { - return 100; - } - - return 0; + return this.isOwner(member.id) ? 100 : 0; } async onLoad() { @@ -70,10 +66,6 @@ export class BotControlPlugin extends GlobalZeppelinPlugin { } } - isOwner(userId) { - return this.getConfig().owners.includes(userId); - } - @d.command("bot_full_update") @d.permission("can_use") async fullUpdateCmd(msg: Message) { diff --git a/src/plugins/GlobalZeppelinPlugin.ts b/src/plugins/GlobalZeppelinPlugin.ts index b1dba184..c49da5aa 100644 --- a/src/plugins/GlobalZeppelinPlugin.ts +++ b/src/plugins/GlobalZeppelinPlugin.ts @@ -110,4 +110,9 @@ export class GlobalZeppelinPlugin extend const mergedOptions = this.getMergedOptions(); // This implicitly also validates the config return super.runLoad(); } + + protected isOwner(userId) { + const owners = this.knub.getGlobalConfig().owners || []; + return owners.includes(userId); + } }