@@ -15,7 +15,6 @@ import com.kotlindiscord.kord.extensions.parsers.DurationParserException
15
15
import com.kotlindiscord.kord.extensions.utils.getJumpUrl
16
16
import dev.kord.common.asJavaLocale
17
17
import dev.kord.common.entity.ButtonStyle
18
- import dev.kord.core.behavior.channel.asChannelOf
19
18
import dev.kord.core.entity.channel.Channel
20
19
import dev.kord.x.emoji.DiscordEmoji
21
20
import dev.kord.x.emoji.Emojis
@@ -124,6 +123,7 @@ suspend fun VoteBotModule.createCommand() = ephemeralSlashCommand(::CreateArgume
124
123
125
124
lateinit var addOptionButton: InteractionButtonWithAction <* , * >
126
125
lateinit var removeOptionButton: InteractionButtonWithAction <* , * >
126
+ lateinit var submitButton: InteractionButtonWithAction <* , * >
127
127
128
128
addOptionButton = ephemeralButton(::AddOptionModal , row = 1 ) {
129
129
label = translate(" commands.create.interactive.add_option.label" )
@@ -143,6 +143,9 @@ suspend fun VoteBotModule.createCommand() = ephemeralSlashCommand(::CreateArgume
143
143
disable()
144
144
}
145
145
removeOptionButton.enable()
146
+ if (poll.options.size >= 2 ) {
147
+ submitButton.enable()
148
+ }
146
149
update()
147
150
}
148
151
}
@@ -176,6 +179,9 @@ suspend fun VoteBotModule.createCommand() = ephemeralSlashCommand(::CreateArgume
176
179
if (poll.options.isEmpty()) {
177
180
disable()
178
181
}
182
+ if (poll.options.size < 2 ) {
183
+ submitButton.disable()
184
+ }
179
185
addOptionButton.enable()
180
186
update()
181
187
edit {
@@ -194,6 +200,7 @@ suspend fun VoteBotModule.createCommand() = ephemeralSlashCommand(::CreateArgume
194
200
emoji(Emojis .heavyCheckMark.toString())
195
201
label = translate(" commands.create.interactive.submit" )
196
202
bundle = this @createCommand.bundle
203
+ disabled = true
197
204
198
205
action {
199
206
val settings = object : CreateSettings {
0 commit comments