forked from Fascinated/Bat
41 lines
944 B
Java
41 lines
944 B
Java
package cc.fascinated.bat.model;
|
|
|
|
import cc.fascinated.bat.common.ProfileHolder;
|
|
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;
|
|
|
|
import java.util.Date;
|
|
|
|
/**
|
|
* @author Fascinated (fascinated7)
|
|
*/
|
|
@RequiredArgsConstructor
|
|
@Getter @Setter
|
|
@Document(collection = "guilds")
|
|
public class BatGuild extends ProfileHolder {
|
|
/**
|
|
* The ID of the guild
|
|
*/
|
|
@NonNull @Id private final String id;
|
|
|
|
/**
|
|
* The time this guild was joined
|
|
*/
|
|
private Date createdAt = new Date();
|
|
|
|
/**
|
|
* Gets the guild as the JDA Guild
|
|
*
|
|
* @return the guild
|
|
*/
|
|
public Guild getDiscordGuild() {
|
|
return DiscordService.JDA.getGuildById(id);
|
|
}
|
|
}
|