-1
Traceback (most recent call last):
  File "/Users/imnyang/Documents/GitHub/ImBot/main.py", line 17, in <module>
    bot = commands.Bot(command_prefix=f'{what_is_prefix}')
TypeError: __init__() missing 1 required keyword-only argument: 'intents'

I tried to get the token of the discord bot by json, but this problem keeps happening. This is my code :)

main.py

https://github.com/ImNyang/ImBot/blob/main/main.py

  • [Welcome to StackOverflow.](https://stackoverflow.com/tour) You have to create a [`discord.Intents`](https://discordpy.readthedocs.io/en/stable/api.html#intents) object and pass it as a parameter to the `commands.Bot()`. See https://stackoverflow.com/questions/72264673/commands-not-working-from-discord-ext-import-commands#comment127672678_72264673 and https://discordpy.readthedocs.io/en/stable/intents.html. – The Amateur Coder May 20 '22 at 11:12
  • Please [edit] your post to include a [mcve]. Questions should be self contained, and shouldn't be based on off-site resources – TheFungusAmongUs May 20 '22 at 13:14
  • Also, see [how to resolve this error](https://stackoverflow.com/questions/71950432/how-to-resolve-the-following-error-in-discord-py-typeerror-init-missing) – TheFungusAmongUs May 20 '22 at 13:16

0 Answers0