Search in sources :

Example 11 with EmbedBuilder

use of sx.blah.discord.util.EmbedBuilder in project KaellyBot by Kaysoro.

the class RSS method getEmbedObject.

@Override
public EmbedObject getEmbedObject(Language lg) {
    EmbedBuilder builder = new EmbedBuilder();
    builder.withAuthorName("Dofus.com");
    builder.withAuthorUrl(getUrl());
    builder.withTitle(getTitle());
    builder.withColor(16747520);
    builder.withImage(imageUrl);
    builder.withThumbnail(Constants.rssIcon);
    builder.withFooterText(dateFormat.format(new Date(getDate())));
    return builder.build();
}
Also used : EmbedBuilder(sx.blah.discord.util.EmbedBuilder)

Example 12 with EmbedBuilder

use of sx.blah.discord.util.EmbedBuilder in project KaellyBot by Kaysoro.

the class Almanax method getMoreEmbedObject.

@Override
public EmbedObject getMoreEmbedObject(Language lg) {
    EmbedBuilder builder = new EmbedBuilder();
    builder.withTitle(Translator.getLabel(lg, "almanax.embed.title.1") + " " + day);
    builder.withUrl(Translator.getLabel(lg, "almanax.url") + day);
    builder.withDescription(quest);
    builder.withColor(new Random().nextInt(16777216));
    builder.withImage(ressourceURL);
    builder.appendField(Translator.getLabel(lg, "almanax.embed.bonus"), bonus, true);
    builder.appendField(Translator.getLabel(lg, "almanax.embed.offrande"), offrande, true);
    return builder.build();
}
Also used : EmbedBuilder(sx.blah.discord.util.EmbedBuilder) Random(java.util.Random)

Example 13 with EmbedBuilder

use of sx.blah.discord.util.EmbedBuilder in project KaellyBot by Kaysoro.

the class Almanax method getEmbedObject.

@Override
public EmbedObject getEmbedObject(Language lg) {
    EmbedBuilder builder = new EmbedBuilder();
    builder.withTitle(Translator.getLabel(lg, "almanax.embed.title.1") + " " + day);
    builder.withUrl(Translator.getLabel(lg, "almanax.url") + day);
    builder.withColor(new Random().nextInt(16777216));
    builder.withThumbnail(ressourceURL);
    builder.appendField(Translator.getLabel(lg, "almanax.embed.bonus"), bonus, true);
    builder.appendField(Translator.getLabel(lg, "almanax.embed.offrande"), offrande, true);
    return builder.build();
}
Also used : EmbedBuilder(sx.blah.discord.util.EmbedBuilder) Random(java.util.Random)

Example 14 with EmbedBuilder

use of sx.blah.discord.util.EmbedBuilder in project KaellyBot by Kaysoro.

the class DofusGuild method getEmbedObject.

@Override
public EmbedObject getEmbedObject(Language lg) {
    EmbedBuilder builder = new EmbedBuilder();
    builder.withTitle(name);
    builder.withUrl(url);
    builder.withDescription(Translator.getLabel(lg, "guild.desc"));
    builder.withColor(new Random().nextInt(16777216));
    builder.withThumbnail(littleSkinURL);
    builder.withImage(bigSkinURL);
    builder.appendField(Translator.getLabel(lg, "guild.level"), level, true);
    builder.appendField(Translator.getLabel(lg, "guild.server"), server, true);
    builder.appendField(Translator.getLabel(lg, "guild.creation_date"), creationDate, true);
    builder.appendField(Translator.getLabel(lg, "guild.members_size"), membersSize, true);
    if (alliName != null)
        builder.appendField(Translator.getLabel(lg, "guild.ally"), "[" + alliName + "](" + alliUrl + ")", true);
    if (!mainMembers.isEmpty())
        for (int i = 0; i < mainMembers.size(); i++) builder.appendField(Translator.getLabel(lg, "guild.main_members") + (mainMembers.size() > 1 ? " (" + (i + 1) + "/" + mainMembers.size() + ")" : "") + " : ", mainMembers.get(i), true);
    return builder.build();
}
Also used : EmbedBuilder(sx.blah.discord.util.EmbedBuilder) Random(java.util.Random)

Example 15 with EmbedBuilder

use of sx.blah.discord.util.EmbedBuilder in project KaellyBot by Kaysoro.

the class Set method getEmbedObject.

@Override
public EmbedObject getEmbedObject(Language lg) {
    EmbedBuilder builder = new EmbedBuilder();
    builder.withTitle(name);
    builder.withUrl(url);
    builder.withColor(new Random().nextInt(16777216));
    builder.withThumbnail(skinURL);
    if (level != null && !level.isEmpty())
        builder.appendField(Translator.getLabel(lg, "set.level"), level, true);
    if (composition != null && !composition.isEmpty())
        builder.appendField(Translator.getLabel(lg, "set.composition"), composition, true);
    for (int i = 0; i < bonusPano.length; i++) builder.appendField(Translator.getLabel(lg, "set.bonus.1") + " " + (i + 2) + " " + Translator.getLabel(lg, "set.bonus.2"), bonusPano[i], true);
    return builder.build();
}
Also used : EmbedBuilder(sx.blah.discord.util.EmbedBuilder) Random(java.util.Random)

Aggregations

EmbedBuilder (sx.blah.discord.util.EmbedBuilder)103 IOException (java.io.IOException)19 Random (java.util.Random)17 IUser (sx.blah.discord.handle.obj.IUser)14 MissingArgumentException (me.shadorc.shadbot.exception.MissingArgumentException)13 LoadingMessage (me.shadorc.shadbot.utils.object.LoadingMessage)13 EmbedObject (sx.blah.discord.api.internal.json.objects.EmbedObject)12 JSONObject (org.json.JSONObject)11 IMessage (sx.blah.discord.handle.obj.IMessage)10 List (java.util.List)9 AbstractCommand (me.shadorc.shadbot.core.command.AbstractCommand)9 EmbedUtils (me.shadorc.shadbot.utils.embed.EmbedUtils)9 JSONException (org.json.JSONException)9 EventColor (com.cloudcraftgaming.discal.api.enums.event.EventColor)8 Utils (me.shadorc.shadbot.utils.Utils)8 IChannel (sx.blah.discord.handle.obj.IChannel)8 EventData (com.cloudcraftgaming.discal.api.object.event.EventData)7 FormatUtils (me.shadorc.shadbot.utils.FormatUtils)7 File (java.io.File)6 CommandCategory (me.shadorc.shadbot.core.command.CommandCategory)6