2024-06-24 13:56:01 +01:00
|
|
|
package cc.fascinated.bat.common;
|
|
|
|
|
2024-06-25 11:14:12 +01:00
|
|
|
import lombok.experimental.UtilityClass;
|
2024-06-24 13:56:01 +01:00
|
|
|
import net.dv8tion.jda.api.EmbedBuilder;
|
|
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Fascinated (fascinated7)
|
|
|
|
*/
|
2024-06-25 11:14:12 +01:00
|
|
|
@UtilityClass
|
2024-06-24 13:56:01 +01:00
|
|
|
public class EmbedUtils {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Builds a generic embed
|
|
|
|
*
|
|
|
|
* @param description the description of the embed
|
|
|
|
* @return the embed builder
|
|
|
|
*/
|
|
|
|
public static EmbedBuilder buildGenericEmbed(String description) {
|
|
|
|
return new EmbedBuilder()
|
|
|
|
.setDescription(description)
|
|
|
|
.setTimestamp(LocalDateTime.now())
|
2024-06-24 14:58:57 +01:00
|
|
|
.setColor(Colors.DEFAULT);
|
2024-06-24 13:56:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Builds an error embed
|
|
|
|
*
|
|
|
|
* @param description the description of the embed
|
|
|
|
* @return the embed builder
|
|
|
|
*/
|
|
|
|
public static EmbedBuilder buildErrorEmbed(String description) {
|
|
|
|
return new EmbedBuilder()
|
|
|
|
.setDescription(description)
|
|
|
|
.setTimestamp(LocalDateTime.now())
|
2024-06-24 14:58:57 +01:00
|
|
|
.setColor(Colors.ERROR);
|
2024-06-24 13:56:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Builds a success embed
|
|
|
|
*
|
|
|
|
* @param description the description of the embed
|
|
|
|
* @return the embed builder
|
|
|
|
*/
|
|
|
|
public static EmbedBuilder buildSuccessEmbed(String description) {
|
|
|
|
return new EmbedBuilder()
|
|
|
|
.setDescription(description)
|
|
|
|
.setTimestamp(LocalDateTime.now())
|
2024-06-24 14:58:57 +01:00
|
|
|
.setColor(Colors.SUCCESS);
|
2024-06-24 13:56:01 +01:00
|
|
|
}
|
|
|
|
}
|