Search in sources :

Example 1 with ComponentImpl

use of org.javacord.core.entity.message.component.ComponentImpl in project Javacord by BtoBastian.

the class MessageBuilderBaseDelegateImpl method prepareComponents.

protected void prepareComponents(ObjectNode body, boolean evenIfEmpty) {
    if (evenIfEmpty || !components.isEmpty()) {
        ArrayNode componentsNode = JsonNodeFactory.instance.objectNode().arrayNode();
        components.forEach(highLevelComponent -> componentsNode.add(((ComponentImpl) highLevelComponent).toJsonNode()));
        body.set("components", componentsNode);
    }
}
Also used : ArrayNode(com.fasterxml.jackson.databind.node.ArrayNode) ComponentImpl(org.javacord.core.entity.message.component.ComponentImpl)

Aggregations

ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)1 ComponentImpl (org.javacord.core.entity.message.component.ComponentImpl)1