I need help with my code and I don't know how to fix it

This is my code:

import os
my_secret = os.environ['TOKEN']
from discord_easy_commands import EasyBot
bot = EasyBot ()

And this is my problem:

Traceback (most recent call last):
  File "main.py", line 4, in <module>
    bot = EasyBot ()
TypeError: Client.__init__() missing 1 required keyword-only argument: 'intents'

I don’t know how to fix it.

1 Like

Hi @soggygamer22!

You seem to be using a library that relies on discord.py’s functionality and is extremely outdated (mid-2021). It is a much better idea to switch over to using discord.py itself, and I believe you can fix this with the following code:

import discord
import os

token = os.environ['TOKEN']

client = discord.Client(intents=discord.Intents.default())
# Needs to be a keyword arg, as the error message suggests

I believe you forgot to specify the intents, which is the cause of the error.


My intentions is to make a discord bot talk after the use of commands. Ex: /help /info etc.

1 Like

You should still be able to implement this with discord.py. Are you following a tutorial? If so, I would recommend finding another that uses discord.py itself. Outdated libraries are a huge cause of problems, especially if Discord decides to change its infrastructure.

Yes, I was looking at a tutorial, I just saw the date and it was a year ago. I’ll see if I can find a more recent one. Thank you.

1 Like

No problem! Let me know if you have any further questions :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.