From 52c2bfa0b2500b72e0a4132f6d17f87073f8ad31 Mon Sep 17 00:00:00 2001 From: Dragory Date: Sat, 15 Dec 2018 17:24:09 +0200 Subject: [PATCH] Move canActOn to ZeppelinPlugin base class --- src/plugins/ModActions.ts | 10 ---------- src/plugins/ZeppelinPlugin.ts | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plugins/ModActions.ts b/src/plugins/ModActions.ts index b046a7ca..2cc8277b 100644 --- a/src/plugins/ModActions.ts +++ b/src/plugins/ModActions.ts @@ -914,16 +914,6 @@ export class ModActionsPlugin extends ZeppelinPlugin { } } - protected canActOn(member1, member2) { - if (member1.id === member2.id) { - return false; - } - - const ourLevel = this.getMemberLevel(member1); - const memberLevel = this.getMemberLevel(member2); - return ourLevel > memberLevel; - } - /** * Attempts to message the specified user through DMs and/or the message channel. * Returns a promise that resolves to a boolean indicating whether we were able to message them or not. diff --git a/src/plugins/ZeppelinPlugin.ts b/src/plugins/ZeppelinPlugin.ts index d313303d..c51a54f4 100644 --- a/src/plugins/ZeppelinPlugin.ts +++ b/src/plugins/ZeppelinPlugin.ts @@ -7,4 +7,14 @@ export class ZeppelinPlugin extends Plugin { protected throwPluginRuntimeError(message: string) { throw new PluginRuntimeError(message, this.pluginName, this.guildId); } + + protected canActOn(member1, member2) { + if (member1.id === member2.id) { + return false; + } + + const ourLevel = this.getMemberLevel(member1); + const memberLevel = this.getMemberLevel(member2); + return ourLevel > memberLevel; + } }