Move canActOn to ZeppelinPlugin base class

This commit is contained in:
Dragory 2018-12-15 17:24:09 +02:00
parent 2af174ba1f
commit 52c2bfa0b2
2 changed files with 10 additions and 10 deletions

View file

@ -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.

View file

@ -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;
}
}