All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.builder.message.modify.FollowupMessageModifyBuilder.kt Maven / Gradle / Ivy

There is a newer version: 0.15.0
Show newest version
package dev.kord.rest.builder.message.modify

import dev.kord.common.annotation.KordDsl
import dev.kord.common.entity.optional.map
import dev.kord.common.entity.optional.mapList
import dev.kord.rest.builder.RequestBuilder
import dev.kord.rest.json.request.FollowupMessageModifyRequest
import dev.kord.rest.json.request.MultipartFollowupMessageModifyRequest

@KordDsl
public class FollowupMessageModifyBuilder :
    AbstractMessageModifyBuilder(),
    RequestBuilder {
    // see https://discord.com/developers/docs/interactions/receiving-and-responding#edit-followup-message
    override fun toRequest(): MultipartFollowupMessageModifyRequest = MultipartFollowupMessageModifyRequest(
        request = FollowupMessageModifyRequest(
            content = _content,
            embeds = _embeds.mapList { it.toRequest() },
            flags = buildFlags(),
            allowedMentions = _allowedMentions.map { it.build() },
            components = _components.mapList { it.build() },
            attachments = _attachments.mapList { it.toRequest() },
        ),
        files = files.toList(),
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy