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")
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")
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")
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")
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")
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")
def update_page(message): print_functions.delete_products_page(message, bot) print_functions.print_products(message, bot) logmode.create_log(bot, message, "command")
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")
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")
def answer_audio(message): logmode.create_log(bot, message, "sticker")
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")
def exit_shop(message): print_functions.delete_products_page(message, bot) print_functions.products_menu(message, bot) logmode.create_log(bot, message, "command")