N
N
NeoLight32020-08-02 10:48:52
Python
NeoLight3, 2020-08-02 10:48:52

IndentationError: unindent does not match any outer indentation level, how to fix?

I'm writing a discord bot in Python.
I made a command that connects to the Tcp - Server on port 2000.

@client.command(pass_context = True)
async def airdrop(ctx):
  sock.connect(("127.0.0.1", 2000))
  sock.send(air_bytes)
  time.sleep(1.5)
  #sock.close()
  await ctx.send('Test Airdrop was sent')


Everything seems to be working, but when adding the sock.close() method, an error pops up:
File "bot.py", line 49
    sock.close()
               ^
IndentationError: unindent does not match any outer indentation level


What is the problem and how can it be solved?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question