Search in sources :

Example 1 with Bot

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);
    });
}
Also used : OffsetDateTime(java.time.OffsetDateTime) Bot(gg.projecteden.nexus.features.discord.Bot)

Aggregations

Bot (gg.projecteden.nexus.features.discord.Bot)1 OffsetDateTime (java.time.OffsetDateTime)1