-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-420 Add an option to define permission, which allows bypassing coo…
…ldown (#420)
- Loading branch information
Rafał Chomczyk
authored
Aug 22, 2024
1 parent
ffd2239
commit 084e080
Showing
5 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,11 @@ public Flow validate(Invocation<SENDER> invocation, MetaHolder metaHolder) { | |
} | ||
|
||
private Flow validateCooldown(Invocation<SENDER> invocation, CooldownContext cooldownContext) { | ||
String bypassPermission = cooldownContext.getBypassPermission(); | ||
if (!bypassPermission.isEmpty() && invocation.platformSender().hasPermission(bypassPermission)) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
rchomczyk
Contributor
|
||
return Flow.continueFlow(); | ||
} | ||
|
||
CooldownCompositeKey compositeKey = new CooldownCompositeKey(invocation.platformSender().getIdentifier(), cooldownContext.getKey()); | ||
|
||
Instant now = Instant.now(); | ||
|
So shouldn't
dev.rollczi.litecommands.platform.PlatformSender#hasPermission
be removed?