forked from SteamWar/SteamWar
Fix VacationCommand
This commit is contained in:
@@ -54,7 +54,7 @@ public class VacationCommand extends ListenerAdapter {
|
|||||||
.addOptions(new OptionData(OptionType.STRING, "from", "Datum (TT.MM.JJJJ)", true),
|
.addOptions(new OptionData(OptionType.STRING, "from", "Datum (TT.MM.JJJJ)", true),
|
||||||
new OptionData(OptionType.STRING, "to", "Datum (TT.MM.JJJJ)", true)));
|
new OptionData(OptionType.STRING, "to", "Datum (TT.MM.JJJJ)", true)));
|
||||||
COMMAND.addSubcommands(new SubcommandData("delete", "Lösche deinen Urlaub")
|
COMMAND.addSubcommands(new SubcommandData("delete", "Lösche deinen Urlaub")
|
||||||
.addOptions(new OptionData(OptionType.INTEGER, "vacation", "Dein Urlaub", true, true)));
|
.addOptions(new OptionData(OptionType.STRING, "vacation", "Dein Urlaub", true, true)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -132,7 +132,7 @@ public class VacationCommand extends ListenerAdapter {
|
|||||||
|
|
||||||
private void deleteVacation(SlashCommandInteractionEvent event) {
|
private void deleteVacation(SlashCommandInteractionEvent event) {
|
||||||
InteractionHook interactionHook = event.deferReply(true).complete();
|
InteractionHook interactionHook = event.deferReply(true).complete();
|
||||||
long eventId = event.getOption("vacation").getAsLong();
|
String eventId = event.getOption("vacation").getAsString();
|
||||||
ScheduledEvent scheduledEvent = guild.getScheduledEventById(eventId);
|
ScheduledEvent scheduledEvent = guild.getScheduledEventById(eventId);
|
||||||
if (scheduledEvent == null) {
|
if (scheduledEvent == null) {
|
||||||
interactionHook.editOriginal("Konnte den Urlaub nicht finden!").queue();
|
interactionHook.editOriginal("Konnte den Urlaub nicht finden!").queue();
|
||||||
@@ -180,7 +180,7 @@ public class VacationCommand extends ListenerAdapter {
|
|||||||
.filter(pair -> pair.right().startsWith(vacation))
|
.filter(pair -> pair.right().startsWith(vacation))
|
||||||
.limit(25)
|
.limit(25)
|
||||||
.map(pair -> {
|
.map(pair -> {
|
||||||
return new Command.Choice(pair.right(), Long.parseLong(pair.left().getLocation()));
|
return new Command.Choice(pair.right(), pair.left().getId());
|
||||||
})
|
})
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
event.replyChoices(choices)
|
event.replyChoices(choices)
|
||||||
|
|||||||
Reference in New Issue
Block a user