use of org.javacord.api.entity.message.component.HighLevelComponent in project Javacord by BtoBastian.
the class MessageBuilderBaseDelegateImpl method copy.
/**
* Fill the builder's values with a message.
*
* @param message The message to copy.
*/
@Override
public void copy(Message message) {
this.getStringBuilder().append(message.getContent());
message.getEmbeds().forEach(embed -> addEmbed(embed.toBuilder()));
for (MessageAttachment attachment : message.getAttachments()) {
// Since spoiler status is encoded in the file name, it is copied automatically.
this.addAttachment(attachment.getUrl());
}
for (HighLevelComponent component : message.getComponents()) {
if (component.getType() == ComponentType.ACTION_ROW) {
ActionRowBuilder builder = new ActionRowBuilder();
builder.copy((ActionRow) component);
this.addComponents(builder.build());
}
}
contentChanged = false;
componentsChanged = false;
attachmentsChanged = false;
embedsChanged = false;
}
Aggregations