def info(update, context): info_msg = 'Thats my boring bot, based on star trek text rpg from 1971.\n' \ 'https://github.com/SimonBorin/trek_bot/\n' \ '@blooomberg\n' context.bot.edit_message_text(chat_id=update.effective_chat.id, message_id=update.callback_query.message.message_id, text=info_msg, reply_markup=menu_keyboard())
def location_handler(message): print(message.location) users.set_location(message.chat.id, message.location.longitude, message.location.latitude) is_confirmed = users.confirm_order(message.chat.id) if is_confirmed: text = "Your order is confirmed we will contact you soon\n\n\n" text += users.get_box_details(message.chat.id, data_instance.products_with_details) bot.send_message(chat_id=message.chat.id, text=text) keyboard = keyboards.menu_keyboard() bot.send_message(message.chat.id, text="Press start shopping", reply_markup=keyboard) else: bot.send_message( message.chat.id, text="Your data might be lost for long waiting olease try again", reply_markup=keyboards.menu_keyboard())
def start_handler(message): # utils.get_user_data(message) users.set_user_data(message) users.upload_user_data(message) key = keyboards.menu_keyboard() text = txt.wellcome_txt bot.send_message(chat_id=message.chat.id, text=text, reply_markup=key, parse_mode="HTML")
def back2menu(update, context): query = update.callback_query msg = '''``` ╔╦╗╔═╗╦╔╗╔ ║║║╠═╣║║║║ ╩ ╩╩ ╩╩╝╚╝ ```''' context.bot.edit_message_text(chat_id=query.message.chat_id, message_id=update.callback_query.message.message_id, text=msg, reply_markup=menu_keyboard(), parse_mode=telegram.ParseMode.MARKDOWN)
async def missed_message(message: types.Message): await bot.send_message(message.chat.id, _("Seems you confused language"), reply_markup=keyboards.menu_keyboard(_))
async def menu_handler(message: types.Message): text = _("This is ReplyKeyboardMarkup menu example in multilanguage bot.") await bot.send_message(message.chat.id, text, reply_markup=keyboards.menu_keyboard(_))
def cancel_handler(message): data_instance.init_or_refresh_data() key = keyboards.menu_keyboard() text = "Wellcome to ou shop to sturt shopping please press appropriate button" # Text package bot.send_message(chat_id=message.chat.id, text=text, reply_markup=key)