J
J
Ju12021-11-01 19:10:14
Python
Ju1, 2021-11-01 19:10:14

Python code won't run, how to fix?

The bot started and everything was fine, but after adding intents to the bot, it started to give an error. How to fix?

import discord
from discord.ext import commands
bot = commands.Bot(command_prefix='.', intents=discord.Intents.all())

@bot.event
async def on_ready():
    print('Бот запущен')
token = open('token.txt', 'r').readline()
bot.run(token)

Mistake:

Traceback (most recent call last):

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question