(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

@@ -7,11 +7,22 @@ import net.dv8tion.jda.api.interactions.commands.OptionType;
import net.dv8tion.jda.api.interactions.commands.build.CommandData;
import net.dv8tion.jda.api.interactions.commands.build.Commands;
import org.jetbrains.annotations.NotNull;
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.SlashCommandImpl;
@Component
public class SlashKickCommand extends SlashCommandImpl
{
private final UserPunishment userPunishment;
public SlashKickCommand(@Autowired UserPunishment userPunishment)
{
this.userPunishment = userPunishment;
}
@Override
public CommandData getSlashCommandData()
{
@@ -31,6 +42,6 @@ public class SlashKickCommand extends SlashCommandImpl
@Override
public void runSlashCommand(@NotNull SlashCommandInteractionEvent event)
{
UserPunishment.handle(event, UserPunishment.PunishmentType.KICK);
userPunishment.handle(event, UserPunishment.PunishmentType.KICK);
}
}