Skip to content

Commit

Permalink
No longer require expires
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Aug 25, 2024
1 parent 2a306cd commit 274cf12
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions rest/src/commonMain/kotlin/builder/message/PollBuilder.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package dev.kord.rest.builder.message

import dev.kord.common.annotation.KordDsl
import dev.kord.rest.json.request.CreatablePoll
import dev.kord.common.entity.DiscordPartialEmoji
import dev.kord.common.entity.DiscordPoll
import dev.kord.common.entity.PollLayoutType
Expand All @@ -10,6 +9,7 @@ import dev.kord.common.entity.optional.Optional
import dev.kord.common.entity.optional.coerceToMissing
import dev.kord.common.entity.optional.delegate.delegate
import dev.kord.rest.builder.RequestBuilder
import dev.kord.rest.json.request.CreatablePoll
import kotlinx.datetime.Clock
import kotlinx.datetime.Instant
import kotlin.time.Duration
Expand Down Expand Up @@ -115,7 +115,7 @@ public class PollBuilder : RequestBuilder<CreatablePoll> {
override fun toRequest(): CreatablePoll = CreatablePoll(
question ?: error("Please set a question"),
answers,
expiry ?: error("Please set an expiry"),
expiry,
_allowMultiselect,
layoutType
)
Expand Down
2 changes: 1 addition & 1 deletion rest/src/commonMain/kotlin/json/request/MessageRequests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public data class MultipartForumThreadMessageCreateRequest(
public data class CreatablePoll(
val question: DiscordPoll.Media,
val answers: List<DiscordPoll.Answer>,
val expiry: Instant,
val expiry: Instant?,
@SerialName("allow_multiselect")
val allowMultiselect: Optional<Boolean> = Optional.Missing(),
@SerialName("layout_type")
Expand Down

0 comments on commit 274cf12

Please sign in to comment.