use of discord4j.core.event.domain.message.MessageCreateEvent in project KaellyBot by Kaysoro.
the class AboutCommand method request.
@Override
public void request(MessageCreateEvent event, Message message, Matcher m, Language lg) {
Optional<ApplicationInfo> appInfo = message.getClient().getApplicationInfo().blockOptional();
if (appInfo.isPresent()) {
message.getChannel().flatMap(chan -> chan.createEmbed(spec -> {
spec.setTitle(Translator.getLabel(lg, "about.title").replace("{name}", Constants.name).replace("{version}", Constants.version)).setImage(Constants.changelog).setThumbnail(appInfo.get().getIconUrl(Image.Format.PNG).orElse(null)).addField(Translator.getLabel(lg, "about.invite.title"), Translator.getLabel(lg, "about.invite.desc").replace("{name}", Constants.name).replace("{invite}", Constants.invite), false).addField(Translator.getLabel(lg, "about.support.title"), Translator.getLabel(lg, "about.support.desc").replace("{name}", Constants.name).replace("{discordInvite}", Constants.discordInvite), false).addField(Translator.getLabel(lg, "about.twitter.title"), Translator.getLabel(lg, "about.twitter.desc").replace("{name}", Constants.name).replace("{twitter}", Constants.twitterAccount), false).addField(Translator.getLabel(lg, "about.opensource.title"), Translator.getLabel(lg, "about.opensource.desc").replace("{git}", Constants.git), false).addField(Translator.getLabel(lg, "about.free.title"), Translator.getLabel(lg, "about.free.desc").replace("{paypal}", Constants.paypal), false).addField(Translator.getLabel(lg, "about.privacy.title"), Translator.getLabel(lg, "about.privacy.desc").replace("{paypal}", Constants.paypal), false).addField(Translator.getLabel(lg, "about.graphist.title"), Translator.getLabel(lg, "about.graphist.desc").replace("{graphist}", Graphist.ELYCANN.toMarkdown()), false);
StringBuilder st = new StringBuilder();
for (Donator donator : Donator.values()) st.append(donator.getName()).append(", ");
st.setLength(st.length() - 2);
spec.addField(Translator.getLabel(lg, "about.donators.title"), st.toString() + ".", false);
})).subscribe();
}
}
Aggregations