mirror of
https://github.com/Sheldan/Sissi.git
synced 2026-01-26 19:21:43 +00:00
[SIS-17] fixing meetup failing to create if no location is provided
This commit is contained in:
@@ -73,6 +73,7 @@ public class CreateMeetup extends AbstractConditionableCommand {
|
|||||||
private static final String DESCRIPTION_PARAMETER = "description";
|
private static final String DESCRIPTION_PARAMETER = "description";
|
||||||
private static final String LOCATION_PARAMETER = "location";
|
private static final String LOCATION_PARAMETER = "location";
|
||||||
private static final String CONFIRMATION_TEMPLATE = "createMeetup_confirmation";
|
private static final String CONFIRMATION_TEMPLATE = "createMeetup_confirmation";
|
||||||
|
private static final String DEFAULT_LOCATION_STRING = "\"\"";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||||
@@ -87,7 +88,7 @@ public class CreateMeetup extends AbstractConditionableCommand {
|
|||||||
}
|
}
|
||||||
AUserInAServer organizer = userInServerManagementService.loadOrCreateUser(commandContext.getAuthor());
|
AUserInAServer organizer = userInServerManagementService.loadOrCreateUser(commandContext.getAuthor());
|
||||||
AChannel meetupChannel = channelManagementService.loadChannel(commandContext.getChannel().getIdLong());
|
AChannel meetupChannel = channelManagementService.loadChannel(commandContext.getChannel().getIdLong());
|
||||||
Meetup meetup = meetupManagementServiceBean.createMeetup(meetupTime, meetupTopic, description, organizer, meetupChannel, null);
|
Meetup meetup = meetupManagementServiceBean.createMeetup(meetupTime, meetupTopic, description, organizer, meetupChannel, DEFAULT_LOCATION_STRING);
|
||||||
String confirmationId = componentService.generateComponentId();
|
String confirmationId = componentService.generateComponentId();
|
||||||
String cancelId = componentService.generateComponentId();
|
String cancelId = componentService.generateComponentId();
|
||||||
MeetupConfirmationModel model = MeetupConfirmationModel
|
MeetupConfirmationModel model = MeetupConfirmationModel
|
||||||
@@ -124,7 +125,7 @@ public class CreateMeetup extends AbstractConditionableCommand {
|
|||||||
if(slashCommandParameterService.hasCommandOption(LOCATION_PARAMETER, event)) {
|
if(slashCommandParameterService.hasCommandOption(LOCATION_PARAMETER, event)) {
|
||||||
location = slashCommandParameterService.getCommandOption(LOCATION_PARAMETER, event, String.class);
|
location = slashCommandParameterService.getCommandOption(LOCATION_PARAMETER, event, String.class);
|
||||||
} else {
|
} else {
|
||||||
location = null;
|
location = DEFAULT_LOCATION_STRING;
|
||||||
}
|
}
|
||||||
Instant meetupTime = Instant.ofEpochSecond(time);
|
Instant meetupTime = Instant.ofEpochSecond(time);
|
||||||
AUserInAServer organizer = userInServerManagementService.loadOrCreateUser(event.getMember());
|
AUserInAServer organizer = userInServerManagementService.loadOrCreateUser(event.getMember());
|
||||||
|
|||||||
Reference in New Issue
Block a user