mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 14:11:50 +00:00
Move canActOn to ZeppelinPlugin base class
This commit is contained in:
parent
2af174ba1f
commit
52c2bfa0b2
2 changed files with 10 additions and 10 deletions
|
@ -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.
|
* 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.
|
* Returns a promise that resolves to a boolean indicating whether we were able to message them or not.
|
||||||
|
|
|
@ -7,4 +7,14 @@ export class ZeppelinPlugin extends Plugin {
|
||||||
protected throwPluginRuntimeError(message: string) {
|
protected throwPluginRuntimeError(message: string) {
|
||||||
throw new PluginRuntimeError(message, this.pluginName, this.guildId);
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue