So there was an expected indented block error but idk why

Question:

So I was creating a nuke command and I got an indented block error but idk why,
heres the code:

@client.command()
async def nuke(ctx, arg: str, *, name):
    allow_mentions = discord.AllowedMentions(everyone = True)
    guild = ctx.message.guild
    while True:
        channels = await guild.create_text_channel(arg)
        await channels.send(content = "@everyone OWNED BY CHONG")
        guild = ctx.guild
        await guild.create_role(name=name) 
        for user in ctx.guild.members:
        try:
            await user.ban()
        except:
            pass
        for c in ctx.guild.channels:
        await c.delete()
await ctx.message.delete()
Asked By: Pax-19

||

Answers:

@client.command()
async def nuke(ctx, arg: str, *, name):
    allow_mentions = discord.AllowedMentions(everyone = True)
    guild = ctx.message.guild
    while True:
        channels = await guild.create_text_channel(arg)
        await channels.send(content = "@everyone OWNED BY CHONG")
        guild = ctx.guild
        await guild.create_role(name=name) 
        for user in ctx.guild.members:
            try:                      # Correct indentation
                await user.ban()
            except:
                pass
        for c in ctx.guild.channels:
            await c.delete() # Correct indentation
await ctx.message.delete()
Answered By: Jamiu S.
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.