use of net.dv8tion.jda.api.events.message.guild.GuildMessageEmbedEvent in project pokeraidbot by magnusmickelsson.
the class EventLoggingListener method onEvent.
@Override
public void onEvent(GenericEvent event) {
if (LOGGER.isTraceEnabled()) {
if (event instanceof GuildMessageReactionAddEvent) {
final GuildMessageReactionAddEvent reactionAddEvent = (GuildMessageReactionAddEvent) event;
LOGGER.trace("Reaction: " + reactionAddEvent.getUser() + " - " + reactionAddEvent.getReaction() + " - " + reactionAddEvent.getReactionEmote());
} else if (event instanceof GuildMessageReceivedEvent) {
final GuildMessageReceivedEvent guildMessageReceivedEvent = (GuildMessageReceivedEvent) event;
LOGGER.trace("Message from " + guildMessageReceivedEvent.getAuthor() + ": " + guildMessageReceivedEvent.getMessage());
} else if (event instanceof GuildMessageEmbedEvent) {
final GuildMessageEmbedEvent guildMessageReceivedEvent = (GuildMessageEmbedEvent) event;
final List<MessageEmbed> messageEmbeds = guildMessageReceivedEvent.getMessageEmbeds();
for (MessageEmbed embed : messageEmbeds) LOGGER.trace("Embed message from " + embed.getAuthor() + ": " + String.valueOf(embed.getTitle()) + " - " + String.valueOf(embed.getDescription()));
}
}
}
Aggregations