use of com.github.vaerys.commands.CommandObject in project DiscordSailv2 by Vaerys-Dawn.
the class DailyMsg method getInfo.
public XEmbedBuilder getInfo(DailyMessage messageObject, CommandObject command) {
XEmbedBuilder embedBuilder = new XEmbedBuilder(command);
IUser user = command.client.get().getUserByID(messageObject.getUserID());
if (user != null) {
embedBuilder.withAuthorName(user.getName() + "#" + user.getDiscriminator());
}
if (messageObject.getDay() != null) {
embedBuilder.withTitle(messageObject.getDay() + "");
}
String contents = messageObject.getContents(new CommandObject(command.guild, command.channel.get()));
if (contents.matches("^(> |\\*> |\\*\\*> |\\*\\*\\*> |_> |__> |`> |```> ).*$") || contents.startsWith("> ")) {
embedBuilder.withDesc(contents);
} else {
embedBuilder.withDesc("> " + contents);
}
String formattedFooter;
if (messageObject.getUID() != -1) {
formattedFooter = new Formatter().format("UID: %04d", messageObject.getUID()).toString();
} else {
formattedFooter = messageObject.getSpecialID();
}
embedBuilder.withFooterText(formattedFooter);
return embedBuilder;
}
Aggregations