I followed the tutorial exactly and it keeps saying this:

Traceback (most recent call last): File “main.py”, line 4, in
client = discord.Client()TypeError: init() missing 1 required keyword-only argument: ‘intents’

hi, welcome to the fCC forum.
I am going to reclassify your post to the Python sub-forum as it seems you are asking about Python problem.
Another thing you should know is that there are too many tutorials in fCC so when you say “I followed the tutorial”, we cannot possibly guess which one unless you tell us (by posting a link to whichever tutorial or step you are following).
Finally, it is best when asking a coding related question to post either a link to your code online or provide a complete code snippet (or the whole thing if you’re not sure where the issue is happening).

I hope these suggestions prove useful in the future.

Code a Discord Bot with Python - Host for Free in the Cloud - YouTube - the video

import discord
import os

client = discord.Client()

@client.event
async def on_ready():
    print('We have logged in as{0.user}'.format(client))

@client.event
async def on_message(message):
  if message.author == client.user:
    return

  if message.content.startswith('$hello'):
    await message.channel.send('h3110!')

client.run(os.getenv('TOKEN'))

^^^ my code

and I’m sorry about the classification. when I created an account it changed subs

the tutorial is outdated, the new version of the discord API requires the use of intents.

Check its documentation
https://discordpy.readthedocs.io/

1 Like

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