Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

tried to make a discord bot , but gave an error:

#cod
import discord
from discord.ext import commands

client = discord.Client(intents = discord.Intents().all)

Traceback (most recent call last):File "E:\PyCharm\bot\Bot_state.py", line 4, in client = discord.Client(intents = discord.Intents().all)File "E:\PyCharm\bot\lib\site-packages\discord\client.py", line 248, in __init__self._connection = self._get_state(**options)File "E:\PyCharm\bot\lib\site-packages\discord\client.py", line 265, in _get_statereturn ConnectionState(dispatch=self.dispatch, handlers=self._handlers,File "E:\PyCharm\bot\lib\site-packages\discord\state.py", line 152, in __init__raise TypeError(‘intents parameter must be Intent not %r’ % type(intents))TypeError: intents parameter must be Intent not <class ‘method’>

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You forgot to call all(). The error message therefore is saying that you are trying to pass the method all as argument instead of an Intent (what calling all() is supposed to return).

Here is the correct piece of code:

#cod
import discord
from discord.ext import commands

client = discord.Client(intents = discord.Intents().all())
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading