F
F
frykktik2021-11-12 11:51:32
Python
frykktik, 2021-11-12 11:51:32

What if it works for everyone, but I don't?

I am learning to make bots for discord, I watch the tutorial purely to at least understand the process. He does, and I repeat after him and that's the problem, I did everything like his, but the bot does not want to start. Help who can.

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

@bot.event
async def on_ready():
  print("I am connecred!")

bot.run("")

Here is the text of the error
async def on_ready():
        ^
SyntaxError: invalid syntax

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2021-11-12
@frykktik

unexpected indent - you have an indent inserted where it doesn't belong.
The indentation after the decorator is not required.
Those. instead of

@bot.event
    async def on_ready():
        #тело функции
should be
@bot.event
async def on_ready():
    #тело функции

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question