2024-06-25 10:55:26 +00:00
|
|
|
package cc.fascinated.bat.model;
|
2024-06-24 16:42:57 +00:00
|
|
|
|
2024-06-25 11:36:40 +00:00
|
|
|
import cc.fascinated.bat.common.ProfileHolder;
|
2024-06-24 16:42:57 +00:00
|
|
|
import cc.fascinated.bat.service.DiscordService;
|
|
|
|
import lombok.Getter;
|
|
|
|
import lombok.NonNull;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
import lombok.Setter;
|
|
|
|
import net.dv8tion.jda.api.entities.Guild;
|
|
|
|
import org.springframework.data.annotation.Id;
|
|
|
|
import org.springframework.data.mongodb.core.mapping.Document;
|
|
|
|
|
2024-06-25 14:43:36 +00:00
|
|
|
import java.util.Date;
|
2024-06-24 16:42:57 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Fascinated (fascinated7)
|
|
|
|
*/
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
@Getter @Setter
|
|
|
|
@Document(collection = "guilds")
|
2024-06-25 11:36:40 +00:00
|
|
|
public class BatGuild extends ProfileHolder {
|
2024-06-24 16:42:57 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The ID of the guild
|
|
|
|
*/
|
|
|
|
@NonNull @Id private final String id;
|
|
|
|
|
2024-06-25 14:43:36 +00:00
|
|
|
/**
|
|
|
|
* The time this guild was joined
|
|
|
|
*/
|
|
|
|
private Date createdAt = new Date();
|
|
|
|
|
2024-06-24 16:42:57 +00:00
|
|
|
/**
|
|
|
|
* Gets the guild as the JDA Guild
|
|
|
|
*
|
|
|
|
* @return the guild
|
|
|
|
*/
|
|
|
|
public Guild getDiscordGuild() {
|
|
|
|
return DiscordService.JDA.getGuildById(id);
|
|
|
|
}
|
|
|
|
}
|