forked from Galactic/galactic-bot
response for sharing highest role
This commit is contained in:
parent
c9a10bb34a
commit
2581d91481
@ -7,6 +7,9 @@ You can increase the amount of targets by upgrading to premium.
|
|||||||
[INFRACTION_ERROR]
|
[INFRACTION_ERROR]
|
||||||
an error occured
|
an error occured
|
||||||
|
|
||||||
|
[INFRACTION_PROTECTIONPOSITIONERROR_SAME]
|
||||||
|
they have the same role position as you
|
||||||
|
|
||||||
[INFRACTION_PROTECTIONPOSITIONERROR]
|
[INFRACTION_PROTECTIONPOSITIONERROR]
|
||||||
they have hierarchy over you
|
they have hierarchy over you
|
||||||
|
|
||||||
|
@ -326,9 +326,10 @@ class Infraction {
|
|||||||
if (protection.type === 'position') {
|
if (protection.type === 'position') {
|
||||||
const executorHighest = executor.roles.highest;
|
const executorHighest = executor.roles.highest;
|
||||||
const targetHighest = target.roles.highest;
|
const targetHighest = target.roles.highest;
|
||||||
if (executorHighest.comparePositionTo(targetHighest) <= 0) {
|
if (executorHighest.comparePositionTo(targetHighest) === 0)
|
||||||
|
return this._fail('INFRACTION_PROTECTIONPOSITIONERROR_SAME');
|
||||||
|
if (executorHighest.comparePositionTo(targetHighest) < 0)
|
||||||
return this._fail('INFRACTION_PROTECTIONPOSITIONERROR');
|
return this._fail('INFRACTION_PROTECTIONPOSITIONERROR');
|
||||||
}
|
|
||||||
} else if (protection.type === 'role') {
|
} else if (protection.type === 'role') {
|
||||||
const contains = target.roles.cache.some((r) => protection.roles.includes(r.id));
|
const contains = target.roles.cache.some((r) => protection.roles.includes(r.id));
|
||||||
if (contains) {
|
if (contains) {
|
||||||
|
Loading…
Reference in New Issue
Block a user