Error after watching Tutorial

This is my code

and I get an error in the console that says

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

also, does anyone know why I can’t create a .env file?

If you are referring to the tutorial at Python Discord Bot Tutorial – Code a Discord Bot And Host it for Free , I think it may be outdated. Both replit and appear to have changed in the last two years in ways that would be incompatible what is described there.

Currently, requires you to declare “intents” for your bot, as in this example:

import discord

class MyClient(discord.Client):
    async def on_ready(self):
        print('Logged on as', self.user)

    async def on_message(self, message):
        # don't respond to ourselves
        if == self.user:

        if message.content == 'ping':

intents = discord.Intents.default()
intents.message_content = True
client = MyClient(intents=intents)'token')

You can read more information here: · PyPI

As for .env on replit, you now create a virtual version using the GUI. On the sidebar, click on the padlock icon to create a “secret,” which is a key-value pair that will become a usable environment variable for your program.

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