Can not connect my bot to my db #2443
Unanswered
Vakoo112
asked this question in
Questions and Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello guys so i have a question. I am using jda, spring boot, h2 runtime db, So i have entity called
Player with primary key long id , String joke, So i have created class called BotJokeService which extend ListenerAdapter and i overrode method so basically onMessageReceived !joke my bot gives a random joke , if (!event.getAuthor().isBot()) {
String message = "!joke";
if ("!joke".equals(message)) {
// event.getGuild().mute(user, true).queue(); mute
this is what my public void onMessageReceived(MessageReceivedEvent event) method looks like (i have created playerRepository for BotJokeService class) now i want to register BotJokeService class to my jda listener .addEventListeners(new BotJokeService()) but i cant i dont know what to use for constructor when i am trying to addeventlistener
Beta Was this translation helpful? Give feedback.
All reactions