From c0dbcd584e0cadf5e97e992116387a98b9529017 Mon Sep 17 00:00:00 2001 From: Mushkrem <50112831+Mushkrem@users.noreply.github.com> Date: Sun, 24 Jul 2022 16:56:01 +0200 Subject: [PATCH] Update PermissionsOf.java MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MessageChannel → GuildChannel changing it so changing permission works for voice channels as well --- .../disky/elements/properties/PermissionsOf.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/info/itsthesky/disky/elements/properties/PermissionsOf.java b/src/main/java/info/itsthesky/disky/elements/properties/PermissionsOf.java index e9b32992..0cea7a68 100644 --- a/src/main/java/info/itsthesky/disky/elements/properties/PermissionsOf.java +++ b/src/main/java/info/itsthesky/disky/elements/properties/PermissionsOf.java @@ -38,12 +38,12 @@ public class PermissionsOf extends SimpleExpression { private Expression exprHolder; - private Expression exprChannel; + private Expression exprChannel; @Override public boolean init(Expression @NotNull [] exprs, int matchedPattern, @NotNull Kleenean isDelayed, SkriptParser.@NotNull ParseResult parseResult) { exprHolder = (Expression) exprs[0]; - exprChannel = (Expression) exprs[1]; + exprChannel = (Expression) exprs[1]; return true; } @@ -57,7 +57,7 @@ public void change(@NotNull Event e, Object @NotNull [] delta, Changer.@NotNull if (!EasyElement.isValid(delta)) return; final IPermissionHolder holder = EasyElement.parseSingle(exprHolder, e, null); - final @Nullable MessageChannel channel = EasyElement.parseSingle(exprChannel, e, null); + final @Nullable GuildChannel channel = EasyElement.parseSingle(exprChannel, e, null); final Permission[] perms = (Permission[]) delta; if (EasyElement.anyNull(holder, perms)) return; @@ -82,7 +82,7 @@ public void change(@NotNull Event e, Object @NotNull [] delta, Changer.@NotNull @Override protected Permission @NotNull [] get(@NotNull Event e) { final IPermissionHolder holder = EasyElement.parseSingle(exprHolder, e, null); - final @Nullable MessageChannel channel = EasyElement.parseSingle(exprChannel, e, null); + final @Nullable GuildChannel channel = EasyElement.parseSingle(exprChannel, e, null); if (EasyElement.anyNull(holder)) return new Permission[0]; if (channel != null && !(channel instanceof GuildChannel))