Exemplo n.º 1
0
def exit_details(call):
    print("CAlbback:[" + call.data + "]")
    print_functions.delete_few_messages(call.message.message_id, 1,
                                        call.message.chat.id, bot)
    print_functions.print_products(call.message, bot)

    logmode.create_log(bot, call.message, "command")
Exemplo n.º 2
0
def show_details(call):
    print("CAlbback:[" + call.data + "]")
    tmp_mess = bot.send_message(call.message.chat.id, ".")
    print_functions.delete_products_page(tmp_mess, bot)
    # bot.delete_message(tmp_mess.chat.id, tmp_mess.message_id )
    print_functions.print_details_callback(call.message, call.data, bot)

    logmode.create_log(bot, call.message, "button")
Exemplo n.º 3
0
def increase_page(message):
    curr_page = logmode.get_user_field(message.chat.username, "current_page")

    print_functions.delete_products_page(message, bot)
    logmode.update_user_field("current_page", curr_page + 1,
                              message.chat.username)
    print_functions.print_products(message, bot)

    logmode.create_log(bot, message, "command")
Exemplo n.º 4
0
def add_favourite(call):
    print("CAlbback:[" + call.data + "]")

    # bot.send_photo(call.message.chat.id, "AgADAgAD6KsxG53BuUqdkrXazwk3dX3Rtw8ABAEAAwIAA3gAA5hjAgABFgQ"	)
    print_functions.new_favourite(call, bot)
    print_functions.delete_few_messages(call.message.message_id, 1,
                                        call.message.chat.id, bot)
    print_functions.print_products(call.message, bot)

    logmode.create_log(bot, call.message, "command")
Exemplo n.º 5
0
def answer_text(message):
    code = print_functions.check_if_service_name(message).code
    if print_functions.say_hello(message, bot):  # CHAT-BOT FUNCTIONS
        if config.create_log:
            logmode.create_log(bot, message, "text")
        return
    elif (code >= 0):  # IF STRING IS SHOP NAME
        logmode.create_log(bot, message, "command")
        logmode.update_user_field("current_page", 0, message.chat.username)
        logmode.update_user_field("current_service_code", code,
                                  message.chat.username)
        print_functions.delete_few_messages(message.message_id, 2,
                                            message.chat.id, bot)
        print_functions.print_products(message, bot)
        return
    else:
        print_functions.responce_to_casual_text(
            message, bot)  # DEFAULT ANSWER TO STRING
        if config.create_log:
            logmode.create_log(bot, message, "text")
Exemplo n.º 6
0
def exit_product_menu(message):
    print_functions.delete_few_messages(message.message_id, 2, message.chat.id,
                                        bot)
    print_functions.main_menu(message, bot)

    logmode.create_log(bot, message, "command")
Exemplo n.º 7
0
def update_page(message):
    print_functions.delete_products_page(message, bot)
    print_functions.print_products(message, bot)

    logmode.create_log(bot, message, "command")
Exemplo n.º 8
0
def send_contacts(message):
    print_functions.delete_few_messages(message.message_id, 2, message.chat.id,
                                        bot)
    print_functions.tell_about_contacts(message, bot)

    logmode.create_log(bot, message, "command")
Exemplo n.º 9
0
def print_start(message):
    print_functions.delete_few_messages(message.message_id, 1, message.chat.id,
                                        bot)
    print_functions.main_menu(message, bot)

    logmode.create_log(bot, message, "command")
Exemplo n.º 10
0
def answer_audio(message):
    logmode.create_log(bot, message, "sticker")
Exemplo n.º 11
0
def favourites_menu(message):
    print_functions.delete_few_messages(message.message_id, 2, message.chat.id,
                                        bot)
    logmode.update_user_field("current_page", 0, message.chat.username)
    print_functions.print_favourites(message, bot)
    logmode.create_log(bot, message, "command")
Exemplo n.º 12
0
def exit_shop(message):
    print_functions.delete_products_page(message, bot)
    print_functions.products_menu(message, bot)
    logmode.create_log(bot, message, "command")