(wip) migrate commands to components
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-09-06 22:14:44 +02:00
parent eafa80f1d2
commit 1f2bafa7f8
35 changed files with 359 additions and 174 deletions

View File

@@ -4,6 +4,8 @@ import net.dv8tion.jda.api.Permission;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import wtf.beatrice.hidekobot.commands.base.UserPunishment;
import wtf.beatrice.hidekobot.objects.commands.CommandCategory;
import wtf.beatrice.hidekobot.objects.commands.MessageCommand;
@@ -13,8 +15,15 @@ import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
@Component
public class MessageKickCommand implements MessageCommand
{
private final UserPunishment userPunishment;
public MessageKickCommand(@Autowired UserPunishment userPunishment)
{
this.userPunishment = userPunishment;
}
@Override
public LinkedList<String> getCommandLabels()
@@ -59,6 +68,6 @@ public class MessageKickCommand implements MessageCommand
@Override
public void runCommand(MessageReceivedEvent event, String label, String[] args)
{
UserPunishment.handle(event, args, UserPunishment.PunishmentType.KICK);
userPunishment.handle(event, args, UserPunishment.PunishmentType.KICK);
}
}