diff --git a/rest/src/commonMain/kotlin/service/ChannelService.kt b/rest/src/commonMain/kotlin/service/ChannelService.kt index 81adedd034a..14dfab1289f 100644 --- a/rest/src/commonMain/kotlin/service/ChannelService.kt +++ b/rest/src/commonMain/kotlin/service/ChannelService.kt @@ -1,7 +1,6 @@ package dev.kord.rest.service import dev.kord.common.entity.* -import dev.kord.common.entity.optional.orEmpty import dev.kord.rest.builder.channel.* import dev.kord.rest.builder.channel.thread.StartForumThreadBuilder import dev.kord.rest.builder.channel.thread.StartThreadBuilder @@ -236,7 +235,7 @@ public class ChannelService(requestHandler: RequestHandler) : RestService(reques keys[Route.MessageId] = messageId body(MessageEditPatchRequest.serializer(), request.requests) - request.files.orEmpty().forEach { file(it) } + request.files.forEach { file(it) } } public suspend fun editMessage( @@ -248,7 +247,7 @@ public class ChannelService(requestHandler: RequestHandler) : RestService(reques keys[Route.MessageId] = messageId body(WebhookEditMessageRequest.serializer(), request.request) - request.files.orEmpty().forEach { file(it) } + request.files.forEach { file(it) } } public suspend fun putChannel( diff --git a/rest/src/commonMain/kotlin/service/WebhookService.kt b/rest/src/commonMain/kotlin/service/WebhookService.kt index 70736c0e97d..f921606e829 100644 --- a/rest/src/commonMain/kotlin/service/WebhookService.kt +++ b/rest/src/commonMain/kotlin/service/WebhookService.kt @@ -4,7 +4,6 @@ import dev.kord.common.annotation.KordExperimental import dev.kord.common.entity.DiscordMessage import dev.kord.common.entity.DiscordWebhook import dev.kord.common.entity.Snowflake -import dev.kord.common.entity.optional.orEmpty import dev.kord.rest.builder.message.create.WebhookMessageCreateBuilder import dev.kord.rest.builder.message.modify.WebhookMessageModifyBuilder import dev.kord.rest.builder.webhook.WebhookCreateBuilder @@ -168,7 +167,7 @@ public class WebhookService(requestHandler: RequestHandler) : RestService(reques webhookIdTokenMessageIdThreadId(webhookId, token, messageId, threadId) val body = WebhookMessageModifyBuilder().apply(builder).toRequest() body(WebhookEditMessageRequest.serializer(), body.request) - body.files.orEmpty().onEach { file(it) } + body.files.onEach { file(it) } } }