Discord bot doesnt work

Its my first time creating a bot and i followed a tutorial and i got this code:

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(“Hello!”)

my_secret = os.environ[‘Token’]

but got this error and i dont know what to do:

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

Please help me

Hello and welcome to the community :partying_face:!

You’re missing some setup steps, which can be seen on the quick start guide of the library: Quickstart

Whenever you’re stuck with something, the first thing you should do is read the documentation of the library, framework or SDK you’re using :slight_smile:.

Thank you very much.

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