Darkside138/DiscordSoundboard

Can't Get Bot Working

Closed this issue · 26 comments

Hi there! I used this bot for months without problems but a few weeks ago I (without thinking) updated Java.

Since then however I have removed all trace of Java installs then reinstalled various versions of Java 8 (as recommended by you I believe?) to no avail.

The bot still throws up errors.

e33msb9

The error used to be much bigger but after some jiggery-pokery with wiping out and reinstalling Java 8 I now have the much smaller error above.

I have no errors up until I try to play a file. The bot remove the command in chat but then throws this up at the moment of attempting to play it over the voice chat.

Any help getting my copy up and running again would be appreciated!

Here it is in text form for convenience;

2017-10-11 00:11:40.772 INFO 11924 --- [ main] n.d.discordsoundboard.MainController : Started MainController in 18.285 seconds (JVM running for 19.334)
2017-10-11 00:11:46.951 INFO 11924 --- [inWS-ReadThread] n.d.d.listeners.ChatSoundBoardListener : Attempting to play file: adoo 1 times. Requested by WarBob. ID: 158719407651160064
2017-10-11 00:11:46.980 INFO 11924 --- [inWS-ReadThread] n.d.jda.core.managers.AudioManager : Audio System successfully setup!
2017-10-11 00:11:55.751 ERROR 11924 --- [88 Ready Thread] n.d.jda.core.audio.AudioConnection : Encountered an Exception

java.lang.UnsatisfiedLinkError: Can't obtain static method fromNative(Method, Object) from class com.sun.jna.Native
at com.sun.jna.Native.initIDs(Native Method) ~[classes!/:2.1.1-beta]
at com.sun.jna.Native.(Native.java:148) ~[classes!/:2.1.1-beta]
at tomp2p.opuswrapper.Opus.(Opus.java:29) ~[classes!/:2.1.1-beta]
at net.dv8tion.jda.core.audio.AudioConnection.setupSendSystem(AudioConnection.java:262) ~[classes!/:2.1.1-beta]
at net.dv8tion.jda.core.audio.AudioConnection.lambda$ready$31(AudioConnection.java:126) ~[classes!/:2.1.1-beta]
at net.dv8tion.jda.core.audio.AudioConnection$$Lambda$65/538340269.run(Unknown Source) ~[na:na]
at java.lang.Thread.run(Unknown Source) ~[na:1.8.0]

I used the latest beta available on the main GitHub page (2.1.1-BETA.zip)

Which is also seen in my copy & paste in lines like
".at com.sun.jna.Native.(Native.java:148) ~[classes!/:2.1.1-beta]"

If there a more recent beta than this? If so where do I get it?

I did a blank install before writing up this issue, so my config file is the same as in the 2.1.1 Beta download (with just the username and Bot token changed).

hsn9jqt

I've removed the bot token for this screenshot.

capture

Still seems to be happening.

What specific version/update of Java do you recommend/use?

I currently have the launch version of Java 8 after a bunch of other later versions didn't seem to help.

Perhaps it's that?

Thanks. I'll try whatever version you're running whenever you get the chance in that case.

java

Tried a more recent version of Java 8 again and while it's still not working, the error it outputs is longer.

For the older screenshot I was using "1.8 - 1.8.0", which is the launch version, for the newer screenshot I'm using "1.8 - 1.8.0_151" which seems to be the latest (and possibly last?) version of 1.8.

There really aren't any Discord soundboards with the same simplicity as yours, so it's super sad that I can't seem to use it anymore.

capture

No such luck. I think we can rule out the idea of it being related to a specific version of Java at this point.

You mentioned it's falling back on the wrong player.

The beta doesn't even ship with the player line in the config, so I'd assume it's supposed to default to musicPlayer right?

Then when the line is added, it continues to ignore it and run the wrong player somehow, which doesn't seem to work.

What is musicPlayers dependency that it relies on me having installed?

Also, is there any possibility that it's caching something from the old versions of the soundboard that I could perhaps delete?

Also I'm on Windows 10 if that helps any.

Ah I see. That'd possibly be good! (assuming that doesn't bork on me too, heh).

I'm curious as to why it doesn't seem to register the command in the config file though, 'tis odd.

Any luck with the latest versions of the bot?

2018-02-15 15:27:24.386 INFO 2636 --- [inWS-ReadThread] n.d.d.listeners.ChatSoundBoardListener : Attempting to play file: igc?igc 1 times. Requested by Benjamoose. ID: 158719407651160064
2018-02-15 15:27:33.815 INFO 2636 --- [inWS-ReadThread] n.d.d.listeners.ChatSoundBoardListener : Attempting to play file: igc 1 times. Requested by Benjamoose. ID: 158719407651160064
2018-02-15 15:27:33.819 ERROR 2636 --- [inWS-ReadThread] net.dv8tion.jda.core.JDA : One of the EventListeners had an uncaught exception
2018-02-15 15:27:33.821 ERROR 2636 --- [inWS-ReadThread] net.dv8tion.jda.core.JDA : Encountered an Exception

java.lang.NoClassDefFoundError: Could not initialize class tomp2p.opuswrapper.Opus
at net.dv8tion.jda.core.audio.AudioConnection.setupSendSystem(AudioConnection.java:262) ~[classes!/:2.2.2-beta]
at net.dv8tion.jda.core.audio.AudioConnection.setSendingHandler(AudioConnection.java:148) ~[classes!/:2.2.2-beta]
at net.dv8tion.jda.core.managers.impl.AudioManagerImpl.setSendingHandler(AudioManagerImpl.java:199) ~[classes!/:2.2.2-beta]
at net.dirtydeeds.discordsoundboard.service.SoundPlayerImpl.moveToChannel(SoundPlayerImpl.java:415) ~[classes!/:2.2.2-beta]
at net.dirtydeeds.discordsoundboard.service.SoundPlayerImpl.moveToUserIdsChannel(SoundPlayerImpl.java:403) ~[classes!/:2.2.2-beta]
at net.dirtydeeds.discordsoundboard.service.SoundPlayerImpl.playFileForEvent(SoundPlayerImpl.java:229) ~[classes!/:2.2.2-beta]
at net.dirtydeeds.discordsoundboard.listeners.ChatSoundBoardListener.onMessageReceived(ChatSoundBoardListener.java:270) ~[classes!/:2.2.2-beta]
at net.dv8tion.jda.core.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:404) ~[classes!/:2.2.2-beta]
at net.dv8tion.jda.core.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:84) ~[classes!/:2.2.2-beta]
at net.dv8tion.jda.core.handle.MessageCreateHandler.handleDefaultMessage(MessageCreateHandler.java:128) [classes!/:2.2.2-beta]
at net.dv8tion.jda.core.handle.MessageCreateHandler.handleInternally(MessageCreateHandler.java:49) [classes!/:2.2.2-beta]
at net.dv8tion.jda.core.handle.SocketHandler.handle(SocketHandler.java:37) [classes!/:2.2.2-beta]
at net.dv8tion.jda.core.requests.WebSocketClient.handleEvent(WebSocketClient.java:969) [classes!/:2.2.2-beta]
at net.dv8tion.jda.core.requests.WebSocketClient.onTextMessage(WebSocketClient.java:661) [classes!/:2.2.2-beta]
at com.neovisionaries.ws.client.ListenerManager.callOnTextMessage(ListenerManager.java:352) [classes!/:2.2.2-beta]
at com.neovisionaries.ws.client.ReadingThread.callOnTextMessage(ReadingThread.java:260) [classes!/:2.2.2-beta]
at com.neovisionaries.ws.client.ReadingThread.callOnTextMessage(ReadingThread.java:238) [classes!/:2.2.2-beta]
at com.neovisionaries.ws.client.ReadingThread.handleTextFrame(ReadingThread.java:963) [classes!/:2.2.2-beta]
at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:746) [classes!/:2.2.2-beta]
at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108) [classes!/:2.2.2-beta]
at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64) [classes!/:2.2.2-beta]
at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45) [classes!/:2.2.2-beta]

I just tried based on your comment.

It still no longer works for me on 2.2.2-BETA

I've actually been temporarily using a different bot for the time-being.

What kind of file are you attempting to play here? Have you tried other file formats? Does the bot respond to normal commands like ?list, ?help, etc?

Just a folder of standard short .mp3 sound files rendered out of Audacity, Adobe Audition or Sony Vegas.

The same files were being played by the bot before this became a problem too.

As far as I recall the bot operates as intended otherwise, so you can PM it, execute commands, etc.

When doing a voice command, it even joins the audio channel, so it's definitely trying.

I'm on Windows 10 if that helps any.

Okay! So update!

I updated to the absolute latest Java again. Then I noted that the app.properties default text in the download was different to the one on the main page, so I copied and pasted that into it and then customized that version.

Ran the bot and all seems to be working once again at last!

Woo!

I'll close this now.

A couple of feature idea though:

  • When multiple servers can use the same instance of the bot, maybe allow subfolders for sounds?
    Sort of like, I can give server A access to one set of sounds, and server B access to another. Would be neat!

  • A command to make the bot leave someone's server remotely from the console.

Have an update that might help with why this was happening.

I've been grooving along (since this fixed itself) on 1.8.0_161 x86 (32bit edition of this Java version).

Just tonight however, a different application needed the 64bit version.

So I installed the EXACT same version, but 64bit and now the soundboard is broken again.
image

I just removed the 64bit version and did a system restart and now it's working again.

Seems the bot doesn't play nice with multiple Java installs/64bit Java on Windows.