Esempio n. 1
0
def user_update_code(message):
    try:
        chat_id = message.chat.id
        exists = database.worker_exists_code(message.text)

        if (exists is not False):
            username = repl(message.from_user.username)
            database.user_update_invite_code(chat_id, message.text)

            bot.send_message(
                chat_id,
                f"🙋🏻‍♀️ Добро пожаловать, *{message.from_user.first_name}*\nУ нас очень большой выбор вида игр, которые подойдут для каждого пользователя",
                parse_mode="Markdown",
                reply_markup=keyboard.casino_keyboard())

            notification_nu(message.text, message.from_user.first_name,
                            username)
        else:
            message = bot.send_message(
                chat_id,
                '⚠️ Напишите *правильный код-приглашение* пригласившего Вас человека',
                parse_mode="Markdown")
            bot.register_next_step_handler(message, user_invite_code)

    except:
        pass
Esempio n. 2
0
def worker_payments(code):
    try:
        array = []
        with sqlite3.connect("evidence.db") as con:
            cur = con.cursor()
            result = cur.execute('SELECT * FROM `payments` WHERE `code` = ?',
                                 (code, )).fetchall()
            for row in result:
                username = repl(row[2])
                array.append(f"({row[0]}) - {row[2]} ₽")

            return array
    except:
        return 0
Esempio n. 3
0
def worker_mamonts(invite_code):
    try:
        array = []
        with sqlite3.connect("evidence.db") as con:
            cur = con.cursor()
            result = cur.execute(
                'SELECT * FROM `users` WHERE `invite_code` = ?',
                (invite_code, )).fetchall()
            for row in result:
                username = repl(row[2])
                array.append(f"({row[0]}) - @{row[2]} - {row[3]} ₽ - {row[9]}")

            return array
    except:
        return 0