2022-12-21 17:59:25 +01:00
|
|
|
package wtf.beatrice.hidekobot.listeners;
|
|
|
|
|
|
|
|
import net.dv8tion.jda.api.events.interaction.component.StringSelectInteractionEvent;
|
|
|
|
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
2023-01-16 07:20:49 +01:00
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
2022-12-21 23:31:12 +01:00
|
|
|
import wtf.beatrice.hidekobot.commands.base.Trivia;
|
2022-12-21 17:59:25 +01:00
|
|
|
|
|
|
|
public class SelectMenuInteractionListener extends ListenerAdapter
|
|
|
|
{
|
|
|
|
|
2023-01-16 07:20:49 +01:00
|
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(SelectMenuInteractionListener.class);
|
|
|
|
|
2022-12-21 17:59:25 +01:00
|
|
|
@Override
|
|
|
|
public void onStringSelectInteraction(StringSelectInteractionEvent event)
|
|
|
|
{
|
|
|
|
switch (event.getComponentId().toLowerCase()) {
|
|
|
|
|
|
|
|
// trivia
|
2022-12-21 23:31:12 +01:00
|
|
|
case "trivia_categories" -> Trivia.handleMenuSelection(event);
|
2023-01-16 07:20:49 +01:00
|
|
|
|
|
|
|
// error handling
|
|
|
|
default -> LOGGER.warn("Received unhandled {}", event.getClass().getSimpleName());
|
2022-12-21 17:59:25 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|