Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @bot.on.message('клик', lower=True)
- async def wrapper(ans: Message):
- if ans.from_id < 0:
- pass
- else:
- q.execute(f"SELECT * FROM bots WHERE userid = {ans.from_id}")
- result = q.fetchall()
- win = random.randint(1,3)
- q.execute("UPDATE bots SET balance = '%s' WHERE userid = '%s'" % (result[0][1] + win))
- balance = result[0][1]
- connection.commit()
- await ans(f'{balance}')
- if len(result) == 0:
- user = await bot.api.users.get(user_ids=ans.from_id)
- name = user[0]['first_name']
- q.execute('INSERT INTO bots (balance, userid, nickname) VALUES ("%s", "%s", "%s")' % (0, ans.from_id, name))
- await ans('zaregal')
- connection.commit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement