Added a way to add new lines in the description of a poll (it's done in a weird way though /n instead of \n)

This commit is contained in:
Teriuihi 2023-06-05 02:48:39 +02:00
parent 706ceb4b55
commit 977ae78e39

View File

@ -43,9 +43,10 @@ public class SubCommandEditDescription extends SubCommand {
event.replyEmbeds(Util.genericErrorEmbed("Error", "Description too long")).setEphemeral(true).queue();
return;
}
String finalDescription = description.replaceAll("/n", "\n");
event.replyEmbeds(Util.genericWaitingEmbed("Waiting...", "Editing poll...")).setEphemeral(true).queue(hook -> {
pollChannel.textChannel().retrieveMessageById(pollChannel.poll().getPollId()).queue(message -> updatePoll(message, description, hook),
pollChannel.textChannel().retrieveMessageById(pollChannel.poll().getPollId()).queue(message -> updatePoll(message, finalDescription, hook),
error -> hook.editOriginalEmbeds(Util.genericErrorEmbed("Error", "Unable to find message with id [" + pollChannel.poll().getPollId() + "].")).queue());
});
}