Search in sources :

Example 1 with Donator

use of enums.Donator in project KaellyBot by Kaysoro.

the class AboutCommand method request.

@Override
public boolean request(IMessage message) {
    if (super.request(message)) {
        IUser author = ClientConfig.DISCORD().getApplicationOwner();
        EmbedBuilder builder = new EmbedBuilder();
        Language lg = Translator.getLanguageFrom(message.getChannel());
        builder.withTitle(Translator.getLabel(lg, "about.title").replace("{name}", Constants.name).replace("{version}", Constants.version)).withDesc(Translator.getLabel(lg, "about.desc").replace("{game}", Constants.game)).withColor(new Random().nextInt(16777216)).withThumbnail(ClientConfig.DISCORD().getApplicationIconURL()).withAuthorName(author.getName()).withAuthorIcon(author.getAvatarURL()).withImage(Constants.changelog);
        ;
        builder.appendField(Translator.getLabel(lg, "about.invite.title"), Translator.getLabel(lg, "about.invite.desc").replace("{name}", Constants.name).replace("{invite}", Constants.invite), true).appendField(Translator.getLabel(lg, "about.support.title"), Translator.getLabel(lg, "about.support.desc").replace("{name}", Constants.name).replace("{discordInvite}", Constants.discordInvite), true).appendField(Translator.getLabel(lg, "about.twitter.title"), Translator.getLabel(lg, "about.twitter.desc").replace("{name}", Constants.name).replace("{twitter}", Constants.twitterAccount), true).appendField(Translator.getLabel(lg, "about.opensource.title"), Translator.getLabel(lg, "about.opensource.desc").replace("{git}", Constants.git), true).appendField(Translator.getLabel(lg, "about.free.title"), Translator.getLabel(lg, "about.free.desc").replace("{paypal}", Constants.paypal), true);
        StringBuilder st = new StringBuilder();
        for (Donator donator : Donator.values()) st.append(donator.getName()).append(", ");
        st.setLength(st.length() - 2);
        builder.appendField(Translator.getLabel(lg, "about.donators.title"), st.toString() + ".", true);
        Message.sendEmbed(message.getChannel(), builder.build());
        return true;
    }
    return false;
}
Also used : EmbedBuilder(sx.blah.discord.util.EmbedBuilder) Language(enums.Language) Random(java.util.Random) Donator(enums.Donator) IUser(sx.blah.discord.handle.obj.IUser)

Aggregations

Donator (enums.Donator)1 Language (enums.Language)1 Random (java.util.Random)1 IUser (sx.blah.discord.handle.obj.IUser)1 EmbedBuilder (sx.blah.discord.util.EmbedBuilder)1