Skip to content

Commit

Permalink
Update bypass permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Brikster committed Jul 6, 2024
1 parent 8c81970 commit 750202f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public final class CooldownStrategy implements MessageTransformStrategy<String>
String chatName = context.getChat().getId();

if (context.getChat().getCooldown() > 0
&& !context.getSender().hasPermission("chatty.cooldown." + chatName)) {
&& !context.getSender().hasPermission("chatty.bypass.cooldown")
&& !context.getSender().hasPermission("chatty.bypass.cooldown." + chatName)) {
Cache<CommandSender, Long> cache = cooldownCachesMap.computeIfAbsent(chatName, (k) -> CacheBuilder.newBuilder()
.maximumSize(1000)
.weakKeys()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public AdModerationStrategyModeration(BukkitAudiences audiences, MessagesConfig

@Override
public @NotNull MessageTransformResult<String> handle(MessageContext<String> context) {
if (context.getSender().hasPermission("chatty.moderation.ads.bypass")
|| context.getSender().hasPermission("chatty.moderation.bypass")) {
if (context.getSender().hasPermission("chatty.bypass.moderation")
|| context.getSender().hasPermission("chatty.bypass.moderation.ads")) {
return MessageTransformResultBuilder
.<String>fromContext(context)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public CapsModerationStrategy(BukkitAudiences audiences, MessagesConfig messages

@Override
public @NotNull MessageTransformResult<String> handle(MessageContext<String> context) {
if (context.getSender().hasPermission("chatty.moderation.caps.bypass")
|| context.getSender().hasPermission("chatty.moderation.bypass")) {
if (context.getSender().hasPermission("chatty.bypass.moderation")
|| context.getSender().hasPermission("chatty.bypass.moderation.caps")) {
return MessageTransformResultBuilder
.<String>fromContext(context)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public SwearModerationStrategyModeration(BukkitAudiences audiences, MessagesConf

@Override
public @NotNull MessageTransformResult<String> handle(MessageContext<String> context) {
if (context.getSender().hasPermission("chatty.moderation.swear.bypass")
|| context.getSender().hasPermission("chatty.moderation.bypass")) {
if (context.getSender().hasPermission("chatty.bypass.moderation")
|| context.getSender().hasPermission("chatty.bypass.moderation.swear")) {
return MessageTransformResultBuilder
.<String>fromContext(context)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public static final class ChatConfig extends OkaeriConfig {
@Comment({
"",
"Cooldown in seconds for sending messages in chat.",
"Bypass permission: chatty.cooldown.<chat>"
"Bypass permission: chatty.bypass.cooldown.<chat>"
})
@Min(0)
private int cooldown = 0;
Expand Down

0 comments on commit 750202f

Please sign in to comment.