Skip to content

Commit

Permalink
Increase destroy effect (#11)
Browse files Browse the repository at this point in the history
* 🚀 member join event

* 🚀 member join event

* 🚀 some new events

* 🚀 fix typos

* 🚀 Members of expression

* 🚀 Possibility to destroy more entities
  • Loading branch information
wallace4BR authored Mar 26, 2022
1 parent 2cc9ce2 commit 5ba9867
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
import ch.njol.util.Kleenean;
import info.itsthesky.disky.DiSky;
import info.itsthesky.disky.api.skript.WaiterEffect;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.Role;
import net.dv8tion.jda.api.entities.*;
import net.dv8tion.jda.api.requests.RestAction;
import org.bukkit.event.Event;
import org.jetbrains.annotations.NotNull;
Expand All @@ -26,7 +24,7 @@ public class DestroyEntity extends WaiterEffect {
static {
Skript.registerEffect(
DestroyEntity.class,
"destroy %guild/message/role%"
"destroy %guild/message/role/channel/thread/category%"
);
}

Expand All @@ -52,6 +50,12 @@ else if (entity instanceof Role)
action = ((Role) entity).delete();
else if (entity instanceof Message)
action = ((Message) entity).delete();
else if (entity instanceof Channel)
action = ((Channel) entity).delete();
else if (entity instanceof ThreadChannel)
action = ((ThreadChannel) entity).delete();
else if (entity instanceof Category)
action = ((Category) entity).delete();
else
action = null;
if (anyNull(action)) {
Expand Down

0 comments on commit 5ba9867

Please sign in to comment.