pawel02 / music_bot

Music discord bot with all the functionality you'll ever want
67 stars 91 forks source link

missing 1 required keyword-only argument: 'intents' #19

Open ghost opened 1 year ago

ghost commented 1 year ago

I tried to run my code but this error comes up

Traceback (most recent call last): File "C:\Users\Tom\Downloads\music_bot-main\main.py", line 9, in bot = commands.Bot(command_prefix='/') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: BotBase.init() missing 1 required keyword-only argument: 'intents'

Carlover101 commented 1 year ago

This is because of a recent update in discord where bots now require intents to be enabled in order for commands to work in servers. There are two things you need to do to fix this:

  1. After command_prefix='/', and before the parentheses, add the following: ,intents=discord.Intents.all()
  2. Go to https://discord.com/developers/applications
    • Click on your bot of choice
    • Navigate to the "Bot" tab on the left side
    • Scroll to "Privileged Gateway Intents"
    • Turn the "Presence Intent", "Server Members Intent", and "Message Content Intent" to on.
  3. Done! You should no longer get this error.