#Error In the Discord.py Code

1 messages · Page 1 of 1 (latest)

lilac perch
#

So i installed new discord.py just now and I ran the my program which was written in a older version of discord.py. Now it shows an error as ,

** File "main.py", line 13, in <module>
client = commands.Bot(command_prefix="d!")
TypeError: init() missing 1 required keyword-only argument: 'intents'**

Please help as soon as possible

runic smeltBOT
#
Too Many Tags

Please use either the disnake or python tag, but not both. If your question pertains to disnake, please use the disnake tag. If your question is a general python question that does not depend on disnake, please use the python tag.
I've taken a guess based on the contents of your message which your question is actually about.

If you believe this to be in error, please let us know.

neon gazelle
#

You need to pass intents into your Bot(intents=intents)

#

and rename everything to disnake

neon gazelle
#

and keep_alive? are you hosting it in Repl.it ?

lilac perch
#

@neon gazelle

neon gazelle
# lilac perch yes

Don't use repl.it its going to crash your bot left right and center.
its not finding disnake because you probably have to install it with pip, idk how repl.it works. Its a tool for teaching basic python, not making applications.

neon gazelle
neon gazelle
#

And this is the disnake discord. we have nothing to do with discord.py
The wrappers where similar, but the projects are diverging. If you want support using Discord.py you should head to their discord instead.
Or switch to Disnake

lilac perch
#

oh ok

neon gazelle
# lilac perch will pycharm work?

Pycharm works fine, along with VSCode, or just notepad if you're a masochist. But mostly for developing. Once the bot is up and running you should host it somewhere else. Usually in a VPS, or on some server like hardware of your own. (old computer / raspberry pi, etc )

lilac perch
#

ye

#

Thanks Btw