WalshyDev / AutoCleanBot

Automatically clean a channel in DIscord
16 stars 3 forks source link

Bot not responding to commands #3

Closed jakem72360 closed 6 years ago

jakem72360 commented 6 years ago

Hi,

I recently installed your bot and added it to my Discord server. To test the bot, I sent a message containing the !autoclean list command and the bot replied telling me that I needed to give it the Manage Server permission. I then created a role with said permission, assigned that role to the bot and restarted the bot.

Now, the bot doesn't respond to any messages sent using the ! prefix despite that being the configured prefix and the bot being listed as online in the server. I can't get the bot to respond to any command given to it regardless of the channel in which the command was issued.

I am running the bot on Java 8 and have confirmed that it has a working connection to the MySQL database (the bot has created tables in the database).

If it helps, the bot is being run on my server box under Arch Linux. I've attached the log files containing the bot's output (I have however removed the channel ID's in question). There are a couple suspicious exceptions occuring at runtime which I am not sure if they are related to the problem (such as the Got permission_override exception).

Mar 10 20:28:39 server01 systemd[1]: Started Discord autocleanbot.
-- Subject: Unit autocleanbot.service has finished start-up
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit autocleanbot.service has finished starting up.
-- 
-- The start-up result is RESULT.
Mar 10 20:28:41 server01 java[3773]: [20:28:41] [Info] [JDA]: Login Successful!
Mar 10 20:28:43 server01 java[3773]: [20:28:43] [Info] [JDASocket]: Connected to WebSocket
Mar 10 20:28:43 server01 java[3773]: [20:28:43] [Fatal] [JDASocket]: Received a channel for a guild that isn't a text or voice channel. JSON: {"permission_overwrites":[],"name":"Text Channels","bitrate":64000,"position":1,"id":"<channel-id-redacted>","user_limit":0,"type":4}
Mar 10 20:28:43 server01 java[3773]: [20:28:43] [Fatal] [JDASocket]: Received a channel for a guild that isn't a text or voice channel. JSON: {"permission_overwrites":[],"nsfw":false,"parent_id":null,"name":"Voice Channels","bitrate":64000,"position":2,"id":"<channel-id-redacted>","user_limit":0,"type":4}
Mar 10 20:28:43 server01 java[3773]: [20:28:43] [Fatal] [JDASocket]: Received a channel for a guild that isn't a text or voice channel (ChannelPass). JSON: {"permission_overwrites":[],"name":"Text Channels","bitrate":64000,"position":1,"id":"<channel-id-redacted>","user_limit":0,"type":4}
Mar 10 20:28:43 server01 java[3773]: [20:28:43] [Fatal] [JDASocket]: Encountered an exception:
Mar 10 20:28:43 server01 java[3773]: [20:28:43] [Fatal] [JDASocket]: java.lang.RuntimeException: Got permission_override for unknown channel with id: <channel-id-redacted>
Mar 10 20:28:43 server01 java[3773]:         at net.dv8tion.jda.core.entities.EntityBuilder.createGuildChannelPass(EntityBuilder.java:398)
Mar 10 20:28:43 server01 java[3773]:         at net.dv8tion.jda.core.entities.EntityBuilder.createGuildFirstPass(EntityBuilder.java:285)
Mar 10 20:28:43 server01 java[3773]:         at net.dv8tion.jda.core.handle.GuildCreateHandler.handleInternally(GuildCreateHandler.java:38)
Mar 10 20:28:43 server01 java[3773]:         at net.dv8tion.jda.core.handle.SocketHandler.handle(SocketHandler.java:37)
Mar 10 20:28:43 server01 java[3773]:         at net.dv8tion.jda.core.requests.WebSocketClient.handleEvent(WebSocketClient.java:814)
Mar 10 20:28:43 server01 java[3773]:         at net.dv8tion.jda.core.requests.WebSocketClient.onTextMessage(WebSocketClient.java:517)
Mar 10 20:28:43 server01 java[3773]:         at net.dv8tion.jda.core.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:848)
Mar 10 20:28:43 server01 java[3773]:         at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:368)
Mar 10 20:28:43 server01 java[3773]:         at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:270)
Mar 10 20:28:43 server01 java[3773]:         at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:990)
Mar 10 20:28:43 server01 java[3773]:         at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:749)
Mar 10 20:28:43 server01 java[3773]:         at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108)
Mar 10 20:28:43 server01 java[3773]:         at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64)
Mar 10 20:28:43 server01 java[3773]:         at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)
WalshyDev commented 6 years ago

Can you please try the latest version, link: https://www.dropbox.com/s/zwp10dbdfbcwqj0/AutoCleanBot.zip?dl=0 This was due to Discord adding categories.

jakem72360 commented 6 years ago

Thankyou very much! That solved my problem.

I had a suspicion something like that might be the case as the channel ID reported in the logs was the "Text Channels" category on my server. I was nearly considering recompiling with a new version of JDA as I had thought my version to be the latest :/