S
S
student_py2021-11-17 19:16:00
Python
student_py, 2021-11-17 19:16:00

How to defeat the error "IndentationError: expected an indented block after function definition"?

When I run the file, the following error appears in the console:

File "C:\Users\artem\Desktop\bebra\bot\botrun.py", line 11
    @bot.command()
    ^
IndentationError: expected an indented block after function definition on line 8

My code:

import discord
from discord.ext import commands
import os

bot = commands.Bot(command_prefix="!")

@bot.event
async def on_ready():
  

@bot.command()
async def test(ctx):
  await ctx.send("test")


bot.run(os.getenv("TOKEN"))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
HemulGM, 2021-11-17
@student_py

bat has nothing to do with it. You have a crooked script.
You defined a procedure without a body

async def on_ready():
  pass

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question