use of sx.blah.discord.handle.obj.IMessage in project Shadbot by Shadorc.
the class HangmanManager method show.
private void show() {
List<String> missesList = charsTested.stream().filter(letter -> !word.contains(letter)).collect(Collectors.toList());
EmbedBuilder embed = EmbedUtils.getDefaultEmbed().setLenient(true).withAuthorIcon(this.getAuthor().getAvatarURL()).withAuthorName("Hangman Game").withThumbnail("https://lh5.ggpht.com/nIoJylIWCj1gKv9dxtd4CFE2aeXvG7MbvP0BNFTtTFusYlxozJRQmHizsIDxydaa7DHT=w300").withDescription("Type letters or enter a word if you think you've guessed it.").appendField("Word", this.getRepresentation(word), false).appendField("Misses", FormatUtils.format(missesList, chr -> chr.toString().toUpperCase(), ", "), false);
if (this.isTaskDone()) {
embed.withFooterText("Finished.");
} else {
embed.withFooterText(String.format("Use %scancel to cancel this game (Automatically cancelled in %d min in case of inactivity)", this.getPrefix(), IDLE_MIN));
}
if (failsCount > 0) {
embed.withImage(IMG_LIST.get(Math.min(IMG_LIST.size(), failsCount) - 1));
}
RequestFuture<IMessage> msgRequest = message.send(embed.build());
if (msgRequest != null) {
msgRequest.get();
}
}
Aggregations