Bleuzen / Blizcord

Discord Bot written in Java using JDA and lavaplayer
MIT License
21 stars 6 forks source link

NullPointerException When Playing From YouTube #29

Open chucklesb opened 2 years ago

chucklesb commented 2 years ago

The bot works fine playing local files, but I can't seem to get YouTube links to play. Not sure what I'm doing wrong! Running Arch. I tried building from source and get the same issue.


[13:41:16] [INFO] [Blizcord] Developer: Bleuzen <supgesu@gmail.com>
[13:41:42] [INFO] [Blizcord] Starting bot...
[13:41:42] [INFO] [Blizcord] Config: /home/user/.blizcord/config.json
[13:41:42] [INFO] [Blizcord] Starting JDA...
[13:41:44] [INFO] [Blizcord] Successfully started.
13:41:58.092 [JDA MainWS-ReadThread] ERROR net.dv8tion.jda.api.JDA - One of the EventListeners had an uncaught exception
java.lang.NullPointerException: null
        at com.github.bleuzen.blizcord.a.d.onMessageReceived(Unknown Source)
        at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(Unknown Source)
        at net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(Unknown Source)
        at net.dv8tion.jda.internal.hooks.EventManagerProxy.handleInternally(Unknown Source)
        at net.dv8tion.jda.internal.hooks.EventManagerProxy.handle(Unknown Source)
        at net.dv8tion.jda.internal.JDAImpl.handleEvent(Unknown Source)
        at net.dv8tion.jda.internal.handle.MessageCreateHandler.handleInternally(Unknown Source)
        at net.dv8tion.jda.internal.handle.SocketHandler.handle(Unknown Source)
        at net.dv8tion.jda.internal.requests.WebSocketClient.onDispatch(Unknown Source)
        at net.dv8tion.jda.internal.requests.WebSocketClient.onEvent(Unknown Source)
        at net.dv8tion.jda.internal.requests.WebSocketClient.handleEvent(Unknown Source)
        at net.dv8tion.jda.internal.requests.WebSocketClient.onBinaryMessage(Unknown Source)
        at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(Unknown Source)
        at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(Unknown Source)
        at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(Unknown Source)
        at com.neovisionaries.ws.client.ReadingThread.handleFrame(Unknown Source)
        at com.neovisionaries.ws.client.ReadingThread.main(Unknown Source)
        at com.neovisionaries.ws.client.ReadingThread.runMain(Unknown Source)
        at com.neovisionaries.ws.client.WebSocketThread.run(Unknown Source)```
cSquaerd commented 2 years ago

I did some testing today, I think it may happen if the owner/creator of the server you're on is not in the voice channel. It seems to still happen in 10.5. I think its related to the following line(since this uses getOwner, and thats in the error message): https://github.com/Bleuzen/Blizcord/blob/81497910cfd2e59e383de7c2eed4c49b57c60515/src/com/github/bleuzen/blizcord/bot/Bot.java#L218