use of org.javacord.api.entity.message.MessageAuthor in project Javacord by BtoBastian.
the class MessageCreateHandler method handle.
private void handle(TextChannel channel, JsonNode packet) {
Message message = api.getOrCreateMessage(channel, packet);
MessageCreateEvent event = new MessageCreateEventImpl(message);
Optional<Server> optionalServer = channel.asServerChannel().map(ServerChannel::getServer);
MessageAuthor author = message.getAuthor();
api.getEventDispatcher().dispatchMessageCreateEvent(optionalServer.map(DispatchQueueSelector.class::cast).orElse(api), optionalServer.orElse(null), channel, author.asUser().orElse(null), author.isWebhook() ? author.getId() : null, event);
}
Aggregations