use of gg.projecteden.nexus.features.discord.Bot in project Nexus by ProjectEdenGG.
the class BridgeCommand method executeOnMessage.
private void executeOnMessage(String messageId, Consumer<Message> consumer) {
OffsetDateTime timeCreated = TimeUtil.getTimeCreated(Long.parseLong(messageId));
Bot botGuess = timeCreated.isAfter(grandfather) ? Bot.RELAY : Bot.KODA;
Bot otherBot = botGuess == Bot.KODA ? Bot.RELAY : Bot.KODA;
loadedChannel.getTextChannel(botGuess).retrieveMessageById(messageId).queue(message -> {
if (message.getAuthor().getId().equals(botGuess.getId()))
consumer.accept(message);
else
loadedChannel.getTextChannel(otherBot).retrieveMessageById(messageId).queue(consumer);
});
}
Aggregations