jagrosh / MusicBot

🎶 A Discord music bot that's easy to set up and run yourself!
https://jmusicbot.com
Apache License 2.0
5.36k stars 2.56k forks source link

[Bug Report] Bot does not accept commands in channel #1252

Closed skoinks closed 1 year ago

skoinks commented 1 year ago

Bug Description

Two days ago after restarting the machine the bot is hosted on, it was no longer able to join the voice channel. I've confirmed it isn't issue #1215 as the tickboxes are all checked, the bot and machine are restarted. I noticed after launching the bot the first time after the restart that a link was displayed, sending me to the discord bot app page where it asked me to confirm something (I wasn't paying much attention and only noticed the link after noting the bot won't join the channel). After visiting the link, the output is as expected: [16:40:20] [INFO] [JDA]: Login Successful! [16:40:21] [INFO] [WebSocketClient]: Connected to WebSocket [16:40:21] [INFO] [JDA]: Finished Loading!

I'm able to issue the few commands that are accepted over DMs but anything in the defined channel is ignored.

Steps to Reproduce

  1. Launch bot
  2. Issue play command in defined channel

Expected Result

Expected bot to join voice channel and play audio.

Debug Output

System Properties:
  java.version = 1.8.0_311
  java.vm.name = Java HotSpot(TM) 64-Bit Server VM
  java.vm.specification.version = 1.8
  java.runtime.name = Java(TM) SE Runtime Environment
  java.runtime.version = 1.8.0_311-b11
  java.specification.version = 1.8
  os.arch = amd64
  os.name = Windows 10

JMusicBot Information:
  Version = 0.3.8
  Owner = 262296768539131905
  Prefix = !
  AltPrefix = null
  MaxSeconds = 0
  NPImages = false
  SongInStatus = true
  StayInChannel = true
  UseEval = false
  UpdateAlerts = true

Dependency Information:
  JDA Version = 4.4.0_352
  JDA-Utilities Version = 3.0.5
  Lavaplayer Version = 1.3.78

Runtime Information:
  Total Memory = 194
  Used Memory = 50

Discord Information:
  ID = 887118033217273927
  Guilds = 1
  Users = 2

Additional Info

No response

Checklist

MichailiK commented 1 year ago

Does pinging the bot result in output? If not, ensure that the the bot has the permissions to read & send messages in the channel you're trying to use it in (you can give the bot's role the Administrator permission, to check if its an issue with your permissions.)

If it responds when pinging, but not with your ! prefix, ensure again that the Message Content Intent is enabled. If it is enabled, try disabling it, saving settings, then enabling it again & saving again. I've heard that the message content intent can be finicky & doesn't get applied correctly.

skoinks commented 1 year ago

@MichailiK Thanks for the assist. Toggling administrator permissions was a good tip. For some unbeknownst reason the bot's role was removed from the defined channel's permissions. Adding it resolved this. Much appreciated!