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);
}
}
Aggregations