diff --git a/src/main/java/info/itsthesky/disky/elements/effects/ReplyWith.java b/src/main/java/info/itsthesky/disky/elements/effects/ReplyWith.java index 1fd3c6c1..fa8be065 100644 --- a/src/main/java/info/itsthesky/disky/elements/effects/ReplyWith.java +++ b/src/main/java/info/itsthesky/disky/elements/effects/ReplyWith.java @@ -27,6 +27,7 @@ import net.dv8tion.jda.api.utils.messages.MessageCreateBuilder; import net.dv8tion.jda.api.utils.messages.MessageEditData; import net.dv8tion.jda.api.utils.messages.MessagePollBuilder; +import net.dv8tion.jda.api.utils.messages.MessagePollData; import org.bukkit.event.Event; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -104,6 +105,7 @@ else if (message instanceof EmbedBuilder) builder = new MessageCreateBuilder().addEmbeds(((EmbedBuilder) message).build()); else builder = new MessageCreateBuilder().setContent((String) message); + final @Nullable MessagePollData poll = builder.getPoll(); if (!builder.isValid()) { SkriptUtils.error(node, "The provided message is not valid!"); @@ -128,11 +130,15 @@ else if (message instanceof EmbedBuilder) return; } - otherRestAction = callback.reply(builder.build()).setEphemeral(hidden); + otherRestAction = callback.reply(builder.build()) + .setPoll(poll) + .setEphemeral(hidden); } } else { final MessageEvent event = (MessageEvent) e; - messageRestAction = event.getMessageChannel().sendMessage(builder.build()).setMessageReference(reference); + messageRestAction = event.getMessageChannel().sendMessage(builder.build()) + .setPoll(poll) + .setMessageReference(reference); } }