From 4b9032331522f9adcbc8fe16d0e2ac9db5b12750 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Fri, 26 Mar 2021 17:58:02 +0100 Subject: [PATCH] Make EditWebhookMessageBuilder.embeds a list of builders --- .../kotlin/builder/webhook/EditWebhookMessageBuilder.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rest/src/main/kotlin/builder/webhook/EditWebhookMessageBuilder.kt b/rest/src/main/kotlin/builder/webhook/EditWebhookMessageBuilder.kt index e650c8b622e..80df26c497b 100644 --- a/rest/src/main/kotlin/builder/webhook/EditWebhookMessageBuilder.kt +++ b/rest/src/main/kotlin/builder/webhook/EditWebhookMessageBuilder.kt @@ -16,7 +16,7 @@ class EditWebhookMessageBuilder : RequestBuilder { private var _content: Optional = Optional.Missing() var content: String? by ::_content.delegate() - var embeds: MutableList = mutableListOf() + var embeds: MutableList = mutableListOf() private var _allowedMentions: Optional = Optional.Missing() var allowedMentions: AllowedMentions? by ::_allowedMentions.delegate() @@ -26,10 +26,10 @@ class EditWebhookMessageBuilder : RequestBuilder { contract { callsInPlace(builder, InvocationKind.EXACTLY_ONCE) } - embeds.add(EmbedBuilder().apply(builder).toRequest()) + embeds.add(EmbedBuilder().apply(builder)) } override fun toRequest(): WebhookEditMessageRequest = WebhookEditMessageRequest( - _content, Optional.missingOnEmpty(embeds), _allowedMentions + _content, Optional.missingOnEmpty(embeds.map(EmbedBuilder::toRequest)), _allowedMentions ) -} \ No newline at end of file +}