Answer the question
In order to leave comments, you need to log in
How to make a referral system in a bot?
Hello. I use the following code for the referral system in the bot:
ref_id = message.text.split("?start=")[1] # получаем id реферала
print(ref_id)
if ref_id != usr_id[user_id]:
query = "INSERT INTO refers_neural (`usr_id`, `ref_ids`) VALUES (%s, %s);"
cursor = connect.cursor()
cursor.execute(query, (usr_id[user_id], ref_id))
query_two = "UPDATE users_neural SET invited = invited + 1 WHERE usr_id = %s"
curs = connect.cursor()
curs.execute(query_two, usr_id[user_id])
connect.commit()
print(ref_id)
IndexError: list index out of range
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question