Python Forum

Full Version: Bot refuses to count logs.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
@bot.channel_post_handler(content_types=['text','photo','audio','video','document'])
def posts_from_channels(message):
if True:
try:
messtext = str(message.caption).split('\n')
first_text = messtext[0].split()

if first_text[0] == 'Номер:' and str(message.chat.id) == config.otstuklinkid:
dataLog = messtext[4].split()[1].split('|')
if int(dataLog[0]) >= config.minpass and int(dataLog[1]) >= config.mincookies:
kogoLog = messtext[1].split(' ')
kogoLog = str(kogoLog[1]).replace("@", "")
dataLog = str(messtext[4])
countryLog = str(messtext[5])
sql.execute(f"SELECT id FROM users WHERE login=' { kogoLog } '")
workerid = sql.fetchall()

sql.execute(f"UPDATE users SET alllogs=alllogs+1 WHERE login=' { kogoLog } '")
sql.execute(f"UPDATE infoteam SET alllogsteam=alllogsteam+1")
db.commit()
bot.forward_message(int(workerid[0][0]), message.chat.id, message.message_id)
print('[+] SUCCESS SEND LOG!')
except:
print('[-] ERROR SEND LOG')

help pls