Answer the question
In order to leave comments, you need to log in
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
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question