예제 #1
0
파일: bot.py 프로젝트: XrayT3/Kazbot
def hello(message):
    base.add_user(message)
    bot.send_message(248835526, 'Новая заявка на регистрацию. {name} '.format(name=message.text) + ' id= ' + str(message.from_user.id))
    bot.send_message(message.chat.id, "Qiwi +70000000000\n"\
                                    "Карта 0000 0000 0000 0000\n"\
                                    "Комментарий к платежу {id}".format(id = message.chat.id),
                                                          reply_markup=markups.pay_button())
예제 #2
0
파일: bot.py 프로젝트: XrayT3/Barber
def start(message):
    if message.chat.id in const.admins:
        markup = markups.start_admin()
    else:
        markup = markups.start()
    bot.send_message(message.chat.id,
                     'Привет, ' + message.from_user.first_name + '!',
                     reply_markup=markup)
    base.add_user(message)
예제 #3
0
def start(message):
    base.add_user(message)
    if base.is_seller(message.from_user.id):
        bot.send_message(message.chat.id,
                         const.welcome_celler,
                         reply_markup=markups.start())
    else:
        bot.send_message(message.chat.id,
                         const.welcome_client,
                         reply_markup=markups.start1())
예제 #4
0
def reply_msg(message):
    if (message.text != "Админ-панель"
            and not base.is_in_base(message.chat.id)):
        request_num = base.add_user(message.chat.id)
        if (request_num != -1):
            bot.send_message(message.chat.id,
                             const.reply_msg.format(id=request_num),
                             reply_markup=markups.start())
            bot.send_message(
                const.admin_id,
                str(message.from_user.first_name) + " " +
                str(message.from_user.last_name) + "; @" +
                str(message.from_user.username) + "; " + str(request_num))
            bot.send_message(
                const.admin_id_1,
                str(message.from_user.first_name) + " " +
                str(message.from_user.last_name) + "; @" +
                str(message.from_user.username) + "; " + str(request_num))
            bot.send_message(
                const.admin_id,
                "%s %s Заявка номер: %d" % message.from_user.first_name %
                message.from_user.last_name % request_num)
        else:
            bot.send_message(message.chat.id,
                             "Сервис временно не доступен. Попробуйте позже")
            bot.send_message(const.admin_id,
                             "Ошибка! Не могу выдать номер заявки")
예제 #5
0
파일: main.py 프로젝트: VicGjb/bot
def init_customer_from_call(call):
    if call.message.chat.id in users:
        users[call.message.chat.id] = BeautifulTable()
        users[call.message.chat.id].columns.header = [
            "name", "url", "amount", "price"
        ]
    else:
        #print ('not work')
        add_user(conn='',
                 user_id=call.message.chat.id,
                 name=call.message.from_user.first_name)
        key = init_user(conn='')
        for id in key:
            t = id['user_id']
            users.update({t: f'{t}_basket'})
        #print (users)
        users[call.message.chat.id] = BeautifulTable()
        users[call.message.chat.id].columns.header = [
            "name", "url", "amount", "price"
        ]
        #print(users[call.message.chat.id])
    return users[call.message.chat.id]