mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-05 00:53:04 +00:00
[AB-xxx] adding initial support for components v2
fixing issue with buttons which only provide an emoji adding logging in case updating a starboard post goes wrong
This commit is contained in:
@@ -3,10 +3,10 @@ package dev.sheldan.abstracto.core.interaction;
|
||||
import dev.sheldan.abstracto.core.interaction.button.ButtonConfigModel;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
import net.dv8tion.jda.api.entities.channel.middleman.GuildMessageChannel;
|
||||
import net.dv8tion.jda.api.interactions.components.ActionComponent;
|
||||
import net.dv8tion.jda.api.interactions.components.ActionRow;
|
||||
import net.dv8tion.jda.api.interactions.components.Component;
|
||||
import net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle;
|
||||
import net.dv8tion.jda.api.components.ActionComponent;
|
||||
import net.dv8tion.jda.api.components.actionrow.ActionRow;
|
||||
import net.dv8tion.jda.api.components.Component;
|
||||
import net.dv8tion.jda.api.components.buttons.ButtonStyle;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
@@ -14,6 +14,7 @@ public class CachedAttachment implements Serializable {
|
||||
private Long id;
|
||||
private String proxyUrl;
|
||||
private String fileName;
|
||||
private String contentType;
|
||||
private Boolean spoiler;
|
||||
private Integer size;
|
||||
private Integer height;
|
||||
|
||||
@@ -10,7 +10,7 @@ import net.dv8tion.jda.api.entities.Message;
|
||||
import net.dv8tion.jda.api.entities.MessageEmbed;
|
||||
import net.dv8tion.jda.api.entities.User;
|
||||
import net.dv8tion.jda.api.entities.channel.middleman.MessageChannel;
|
||||
import net.dv8tion.jda.api.interactions.components.ActionRow;
|
||||
import net.dv8tion.jda.api.components.actionrow.ActionRow;
|
||||
import net.dv8tion.jda.api.requests.restaction.AuditableRestAction;
|
||||
import net.dv8tion.jda.api.requests.restaction.MessageEditAction;
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ import lombok.Setter;
|
||||
@Setter
|
||||
@Builder
|
||||
public class MessageConfig {
|
||||
private boolean allowsRoleMention;
|
||||
private boolean allowsEveryoneMention;
|
||||
private Boolean allowsRoleMention;
|
||||
private Boolean allowsEveryoneMention;
|
||||
@Builder.Default
|
||||
private boolean allowsUserMention = true;
|
||||
private Boolean allowsUserMention = true;
|
||||
@Builder.Default
|
||||
private boolean mentionsReferencedMessage = true;
|
||||
private Boolean mentionsReferencedMessage = true;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,9 @@ import dev.sheldan.abstracto.core.models.database.ComponentType;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.dv8tion.jda.api.components.MessageTopLevelComponent;
|
||||
import net.dv8tion.jda.api.entities.MessageEmbed;
|
||||
import net.dv8tion.jda.api.interactions.components.ActionRow;
|
||||
import net.dv8tion.jda.api.components.actionrow.ActionRow;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -20,10 +21,16 @@ import java.util.Map;
|
||||
@Builder
|
||||
public class MessageToSend {
|
||||
/**
|
||||
* The collections of embeds to be send. The first embed is in the same message as the string message.
|
||||
* The collections of embeds to send. The first embed is in the same message as the string message.
|
||||
*/
|
||||
@Builder.Default
|
||||
private List<MessageEmbed> embeds = new ArrayList<>();
|
||||
|
||||
@Builder.Default
|
||||
private List<MessageTopLevelComponent> components = new ArrayList<>();
|
||||
|
||||
@Builder.Default
|
||||
private Boolean useComponentsV2 = false;
|
||||
/**
|
||||
* The string content to be used in the first message.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user