IndentationError: unexpected unindent
WHY? Here's my code:
from praw.models import MoreComments
import praw
import giris
import time
import os
def bot_login():
print("Loggin in...")
r = praw.Reddit(username = giris.username,
password = giris.password,
client_id = giris.client_id,
client_secret = giris.client_secret,
user_agent = "karton_bardak_bot")
print("Logged in!")
return r
info="""
\n
\n
\n
^(ben bot) \n
\n
^(bruh)
"""
subreddit=r.subreddit("shithikayeler")
def run_bot(r, comments_replied_to):
print("Obtaining 25 comments...")
for submission in subreddit.new():
toReply=True
for top_level_comment in submission.comments:
if isinstance(top_level_comment, MoreComments):
continue
if not submission.is_self:
toReply=False
if top_level_comment.author=="karton_bardak_bot" or submission.selftext=='':
toReply=False
print("PASSED "+ submission.url)
log.write("PASSED "+ submission.url+"\n")
if toReply:
try:
new=reply(submission.selftext, info)
submission.reply(new)
except Exception as e:
log.write("ERROR: " + str(e) + " on submission " + submission.url)
print("REPLIED "+ submission.url)
log.write("REPLIED "+submission.url+"\n")
try:
time.sleep(60)
r = bot_login
while True:
run_bot(r)
It says:
File "bot.py", line 57
r = bot_login
^
IndentationError: unexpected unindent
Why? I have checked a thousands times and I can't find the problem. Pls help.