Bastian/sdcf4j

Problem with registering command executor

NaxxoBG opened this issue · 4 comments

Hi, I wanted to show you what I came across while incorporating your framework in my bot. I followed your instructions from the getting started section on how to set it up with the commands and how to register the command executor. When I start the bot, I get the following exception:
Exception in thread "main" java.lang.NoSuchMethodError:
sx.blah.discord.api.IDiscordClient.getDispatcher()Lsx/blah/discord/handle/EventDispatcher
at de.btobastian.sdcf4j.handler.Discord4JHandler.<init>(Discord4JHandler.java:51)

And this is how the client is built and logged in:
this.client = this.builder.login();
CommandHandler handler = new Discord4JHandler(client); ---->The exception occurs here(I checked that client is not null)

The class of client is:
sx.blah.discord.api.internal.DiscordClientImpl

I would really appreciate your input, thanks in advance!

I'm using discord4J I have not encountered this problem I'm thinking it's a mistake in your code somewhere.

Hey,
which version of Discord4J are you using?

I am using version 2.9.2.

Ok, so in the pom.xml for the Version, I replaced LATEST with v1.0.8 and now it's working fine.