(wip) migrate commands to components
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -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 MessageTimeoutCommand implements MessageCommand
|
||||
{
|
||||
private final UserPunishment userPunishment;
|
||||
|
||||
public MessageTimeoutCommand(@Autowired UserPunishment userPunishment)
|
||||
{
|
||||
this.userPunishment = userPunishment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinkedList<String> getCommandLabels()
|
||||
@@ -59,6 +68,6 @@ public class MessageTimeoutCommand implements MessageCommand
|
||||
@Override
|
||||
public void runCommand(MessageReceivedEvent event, String label, String[] args)
|
||||
{
|
||||
UserPunishment.handle(event, args, UserPunishment.PunishmentType.TIMEOUT);
|
||||
userPunishment.handle(event, args, UserPunishment.PunishmentType.TIMEOUT);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user