use of net.robinfriedli.aiode.command.widget.AbstractWidget in project aiode by robinfriedli.
the class WidgetListener method onGuildMessageReactionAdd.
@Override
public void onGuildMessageReactionAdd(GuildMessageReactionAddEvent event) {
if (!event.getUser().isBot()) {
EventHandlerPool.execute(() -> {
long messageId = event.getMessageIdLong();
WidgetRegistry widgetRegistry = guildManager.getContextForGuild(event.getGuild()).getWidgetRegistry();
Optional<AbstractWidget> activeWidget = widgetRegistry.getActiveWidget(messageId);
activeWidget.ifPresent(abstractWidget -> handleWidgetExecution(event, abstractWidget));
});
}
}
Aggregations