Ejemplo n.º 1
0
def make_bill(user_id):
    markup = telebot.types.ReplyKeyboardMarkup(True, False)
    markup.row("Меню")
    markup.row("Регистрация")
    if base.is_seller(user_id):
        markup.row("Панель покупателя")
    return markup
Ejemplo n.º 2
0
def return_to_menu(user_id):
    markup = telebot.types.ReplyKeyboardMarkup(True, False)
    markup.row("Меню")
    #markup.row("Регистрация")
    if base.is_seller(user_id):
        markup.row("Панель покупателя")
    if base.is_admin(user_id):
        markup.row("Админ-панель")
    return markup
Ejemplo n.º 3
0
Archivo: bot.py Proyecto: XrayT3/Kazbot
def client_panel(call):
    if base.is_seller(call.message.chat.id):
        bot.edit_message_text(const.welcome_client, chat_id=call.message.chat.id, message_id=call.message.message_id)
        bot.edit_message_reply_markup(chat_id=call.message.chat.id, message_id=call.message.message_id,
                                  reply_markup=markups.show_types())
    else:
        sent = bot.send_message(call.message.chat.id, "Пожалуйста, введите свой номер телефона",
                                reply_markup=markups.return_to_menu(call.message.chat.id))
        bot.register_next_step_handler(sent, registracy_panel_seller)
Ejemplo n.º 4
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())
Ejemplo n.º 5
0
def show_types(user_id):
    markup = telebot.types.InlineKeyboardMarkup()
    for key in base.give_menu():
        button = telebot.types.InlineKeyboardButton(text=key,
                                                    callback_data=key)
        markup.add(button)
    if base.is_seller(user_id):
        btn_menu = telebot.types.InlineKeyboardButton(
            text="Админ-панель", callback_data='celler_panel')
        markup.add(btn_menu)
    return markup