RzR32 / Discord_Bot-RzR32_Bot

MIT License
0 stars 0 forks source link

Cant use latest JDA Version #23

Closed RzR32 closed 4 years ago

RzR32 commented 4 years ago

Cant run the Bot with the latest JDA Version (JDA:4.1.1_111 and above...).

If I try to start the bot in Intelij it start but if I start it as .jar, the following error occurs:

Exception in thread "main" java.lang.NoSuchMethodError: 'net.dv8tion.jda.api.JDABuilder net.dv8tion.jda.api.JDABuilder.createDefault(java.lang.String) 'at Main.main(Main.java:44)

johanneslosch commented 4 years ago

I tested it on my Mac and I got this error:

johannes@Johannes discord_bot_jar % java -jar discord-bot.jar jar
21:50:53.291 [main] INFO main - -------------------------------------------------- 21:50:53.293 [main] ERROR main - null Exception in thread "main" java.lang.NullPointerException at other.LogBack.removeANSICodefromLOG(LogBack.java:41) at other.LogBack.log(LogBack.java:34) at Main.main(Main.java:96)

My Output-file with release 4.1.1_121 And with IDEA was it runnable

johanneslosch commented 4 years ago

I tested it with my Windows PC (Java 13.0.2) and this was the error:

λ "C:\Program Files\Java\jdk-13.0.2\bin\java.exe" -jar discord-bot.jar 22:29:04.332 [main] INFO main - -------------------------------------------------- 22:29:04.335 [main] ERROR main - null Exception in thread "main" java.lang.NullPointerException at other.LogBack.removeANSICodefromLOG(LogBack.java:41) at other.LogBack.log(LogBack.java:34) at Main.main(Main.java:96)

johanneslosch commented 4 years ago

Somewhere at Line 96 in Main could be a result from AccountBuilder

johanneslosch commented 4 years ago

if I replace the Line 96 with a System.out.println() is the result null

RzR32 commented 4 years ago

I think I found my error - I create a Artifact to have my bot as .jar but my error was I "extracted my bot with a old JDA version 108 or so - now it works (mostly)

It seems like you can't access all members as a list, this make many things unusable ... like GamePlayingCount, Members, Name_Change, Member_join_leave, ...

RzR32 commented 4 years ago

Now I found why the other users wasn´t displayed ... I must check two things on the "Discord Developer Portal" to use the feature (see image below) > now it works! image