#๐ Alignment error
99 messages ยท Page 1 of 1 (latest)
@lofty tree
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
C:\Desktop\Auto MM Bot>python main.py
File "C:\Users\Omari\Desktop\Tools\Auto MM Bot\main.py", line 179
else:
^
IndentationError: unindent does not match any outer indentation level
# User is not found in any channel
error_embed = discord.Embed(
description=f'Error: User {user_id} is not found in any channel in the server.',
color=discord.Color.red()
)
await channel.send(embed=error_embed)
except asyncio.TimeoutError:
timeout_embed = discord.Embed(
description='Timed out. Please create a new ticket if you wish to try again.',
color=discord.Color.red()
)
await channel.send(embed=timeout_embed)
@bot.command()
async def delete(ctx):
if isinstance(ctx.channel, discord.TextChannel):
await ctx.channel.delete()
bot.run(config.BOT_TOKEN) # Using the token from config.py```
hmm
The indentation in your code seems to be inconsistent, leading to "IndentationError"
this may be
oh yes, the except block and the @bot.command() decorator should be at the same indentation level
that's the reason for the error in code
so how do i fix it
..
this is the reason
wait let me provide code
u want the code?
yup
# User is not found in any channel
error_embed = discord.Embed(
description=f'Error: User {user_id} is not found in any channel in the server.',
color=discord.Color.red()
)
await channel.send(embed=error_embed)
except asyncio.TimeoutError:
timeout_embed = discord.Embed(
description='Timed out. Please create a new ticket if you wish to try again.',
color=discord.Color.red()
)
await channel.send(embed=timeout_embed)
@bot.command()
async def delete(ctx):
if isinstance(ctx.channel, discord.TextChannel):
await ctx.channel.delete()
bot.run(config.BOT_TOKEN) # Using the token from config.py
else i won't be able to identify
would this be correct
let me try my best
check if that works now
else:
# User is not found in any channel
error_embed = discord.Embed(
description=f'Error: User {user_id} is not found in any channel in the server.',
color=discord.Color.red()
)
await channel.send(embed=error_embed)
except asyncio.TimeoutError:
timeout_embed = discord.Embed(
description='Timed out. Please create a new ticket if you wish to try again.',
color=discord.Color.red()
)
await channel.send(embed=timeout_embed)
@bot.command()
async def delete(ctx):
if isinstance(ctx.channel, discord.TextChannel):
await ctx.channel.delete()
bot.run(config.BOT_TOKEN) # Using the token from config.py
what is "MM"?
File "C:\Users\Omari\Desktop\Tools\Auto MM Bot\main.py", line 179
else:
^
IndentationError: unindent does not match any outer indentation level
middleman
does it work ?
for what, trading?
yes
legit one?
yes
or dummies?
legit
thank u
if you can
help me finish the code
i dont mind giving it to you
too]
yeah i will try best
like steal or?
wdym
basically
it has a api
that can receive and send ltc
he means do you mine them or crack?
litecoin
and
after receiving the litecoin
it holds it
until the other trader
says he received the product
once he says he received the product
the bot releases the money
to the other trader that gave the product
the way you pasted the code is incorrect so it's hard to help
you need to provide surrounding code too
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
although indentation errors are something very basic to fix, so you might want to revisit the fundamentals
here
does your IDE have the collapse feature?
you can hide all the content of a block except the head of it
this will make it easier for you to figure out where you have went wrong
by hiding away parts that you know are right
oh damn thats hard tbh
ok its fixed
but
@bleak pond
how do i implement buttons in this code
No clue, I don't knows discord bots
Hey @lofty tree!
It looks like you pasted Python code without syntax highlighting.
Please use syntax highlighting to improve the legibility of your code and make it easier for us to help you.
To do this, use the following method:
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
You can **edit your original message** to correct your code block.
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.