Search in sources :

Example 1 with ButtonStyle

use of org.javacord.api.entity.message.component.ButtonStyle in project Javacord by BtoBastian.

the class ButtonBuilderDelegateImpl method copy.

@Override
public void copy(Button button) {
    Optional<String> customId = button.getCustomId();
    Optional<String> url = button.getUrl();
    Optional<String> label = button.getLabel();
    Optional<Emoji> emoji = button.getEmoji();
    Optional<Boolean> isDisabled = button.isDisabled();
    ButtonStyle style = button.getStyle();
    this.setStyle(style);
    customId.ifPresent(this::setCustomId);
    url.ifPresent(this::setUrl);
    label.ifPresent(this::setLabel);
    emoji.ifPresent(this::setEmoji);
    isDisabled.ifPresent(this::setDisabled);
}
Also used : Emoji(org.javacord.api.entity.emoji.Emoji) CustomEmoji(org.javacord.api.entity.emoji.CustomEmoji) ButtonStyle(org.javacord.api.entity.message.component.ButtonStyle)

Aggregations

CustomEmoji (org.javacord.api.entity.emoji.CustomEmoji)1 Emoji (org.javacord.api.entity.emoji.Emoji)1 ButtonStyle (org.javacord.api.entity.message.component.ButtonStyle)1