Ejemplo n.º 1
0
def vacation_contacts(update, context):
    language = context.user_data['user'].get('language')
    if update.callback_query and update.callback_query.data == 'back':
        message = strings.get_string('vacations.create.name', language)
        keyboard = keyboards.get_keyboard('go_back.inline', language)
        update.callback_query.edit_message_text(text=message,
                                                parse_mode=ParseMode.HTML,
                                                reply_markup=keyboard)
        return NAME
    phone_number = update.message.text
    if not phone_number.startswith('+'):
        phone_number = '+' + phone_number
    context.user_data['vacation']['contacts'] = phone_number
    message = strings.get_string('location.regions', language)
    keyboard = keyboards.get_keyboard('location.regions', language)
    remove_keyboard = keyboards.get_keyboard('remove')
    remove_message = strings.get_string('remove_keyboard', language)
    removed_message = context.bot.send_message(chat_id=update.message.chat_id,
                                               text=remove_message,
                                               reply_markup=remove_keyboard,
                                               disable_notification=True)
    context.bot.delete_message(chat_id=update.message.chat_id,
                               message_id=removed_message.message_id)
    message = update.message.reply_text(message, reply_markup=keyboard)
    context.user_data['location_message_id'] = message.message_id
    context.user_data['location_step'] = 'region'
    return REGION
Ejemplo n.º 2
0
def edit_action(update, context):
    context.user_data['user'] = users.user_exists(
        update.callback_query.from_user.id)
    if context.user_data['user'].get('is_blocked'):
        blocked_message = strings.get_string(
            'blocked', context.user_data['user'].get('language'))
        update.callback_query.answer(text=blocked_message, show_alert=True)
        return ConversationHandler.END
    query = update.callback_query
    data = query.data
    language = context.user_data['user'].get('language')
    if data == 'title':
        message = strings.get_string('resumes.edit.title', language)
    elif data == 'description':
        message = strings.get_string('resumes.edit.description', language)
    elif data == 'contacts':
        message = strings.get_string('resumes.edit.contacts', language)
    elif data == 'back':
        resume_message = strings.from_resume(
            context.user_data['editing_resume'], language)
        resume_keyboard = keyboards.get_keyboard('resume', language)
        query.edit_message_text(text=resume_message,
                                reply_markup=resume_keyboard)
        return RESUME_ACTION
    else:
        return EDIT_ACTION
    keyboard = keyboards.get_keyboard('go_back', language)
    context.user_data['editing_resume_step'] = data
    context.bot.delete_message(chat_id=query.message.chat.id,
                               message_id=query.message.message_id)
    context.bot.send_message(chat_id=query.message.chat.id,
                             text=message,
                             reply_markup=keyboard,
                             parse_mode=ParseMode.HTML)
    return UPDATE_RESUME
Ejemplo n.º 3
0
def faq(update, context):
    context.user_data['user'] = users.user_exists(
        update.callback_query.from_user.id)
    if context.user_data['user'].get('is_blocked'):
        blocked_message = strings.get_string(
            'blocked', context.user_data['user'].get('language'))
        update.callback_query.answer(text=blocked_message, show_alert=True)
        return
    if context.user_data['user'].get('language') == 'uz':
        faq_message = settings.get_settings().get('faq_uz')
    else:
        faq_message = settings.get_settings().get('faq')
    faq_message = utils.replace_new_line(faq_message)
    faq_keyboard = keyboards.get_keyboard(
        'faq', language=context.user_data['user'].get('language'))
    context.bot.delete_message(
        chat_id=update.effective_chat.id,
        message_id=update.callback_query.message.message_id)
    image = images.get_faq_image(context.user_data['user'].get('language'))
    if image:
        chat_id = update.effective_message.chat_id
        context.bot.send_photo(chat_id=chat_id,
                               photo=image,
                               caption=faq_message,
                               parse_mode=ParseMode.HTML,
                               reply_markup=faq_keyboard)
    else:
        update.effective_message.reply_text(text=faq_message,
                                            parse_mode=ParseMode.HTML,
                                            reply_markup=faq_keyboard)
Ejemplo n.º 4
0
def partners(update, context):
    context.user_data['user'] = users.user_exists(update.message.from_user.id)
    if context.user_data['user'].get('is_blocked'):
        blocked_message = strings.get_string(
            'blocked', context.user_data['user'].get('language'))
        update.message.reply_text(blocked_message)
        return
    bot_settings = settings.get_settings()
    language = context.user_data['user'].get('language')
    partners_keyboard = keyboards.get_keyboard('partners', language)
    if context.user_data['user'].get('language') == 'uz':
        ad_image_path = bot_settings.get('partners_ad_image_uz')
        partners_message = bot_settings.get('partners_uz')
    else:
        ad_image_path = bot_settings.get('partners_ad_image')
        partners_message = bot_settings.get('partners')
    if not partners_message:
        if context.user_data['user'].get('language') == 'uz':
            partners_message = bot_settings.get('partners_tariffs_uz')
        else:
            partners_message = bot_settings.get('partners_tariffs')
    partners_message = utils.replace_new_line(partners_message)
    if ad_image_path:
        if os.path.exists(ad_image_path):
            image = open(ad_image_path, 'rb')
        else:
            image = images.get_partners_image(
                context.user_data['user'].get('language'))
    else:
        image = images.get_partners_image(
            context.user_data['user'].get('language'))
    photo_message = None
    if image:
        chat_id = update.message.chat_id
        photo_message = context.bot.send_photo(chat_id=chat_id, photo=image)
        message = context.bot.send_message(chat_id=chat_id,
                                           text=partners_message,
                                           parse_mode=ParseMode.HTML,
                                           reply_markup=partners_keyboard)
    else:
        message = update.message.reply_text(text=partners_message,
                                            parse_mode=ParseMode.HTML,
                                            reply_markup=partners_keyboard)
    if 'partners_message_id' in context.user_data:
        try:
            context.bot.delete_message(
                chat_id=update.message.chat_id,
                message_id=context.user_data['partners_message_id'])
        except BadRequest:
            pass
    if 'partners_photo_id' in context.user_data:
        try:
            context.bot.delete_message(
                chat_id=update.message.chat_id,
                message_id=context.user_data['partners_photo_id'])
        except BadRequest:
            pass
    context.user_data['partners_message_id'] = message.message_id
    if photo_message:
        context.user_data['partners_photo_id'] = photo_message.message_id
Ejemplo n.º 5
0
 def to_main_menu(update, language, message_text=None, user_name=None, context=None, welcome=False):
     if message_text:
         menu_message = message_text
     else:
         if welcome:
             menu_message = strings.get_string('start.welcome', language).format(username=user_name)
         else:
             menu_message = strings.get_string('menu.welcome', language)
     menu_keyboard = keyboards.get_keyboard('menu', language)
     if update.message:
         chat_id = update.message.chat_id
     else:
         chat_id = update.callback_query.message.chat_id
     if welcome:
         image = images.get_welcome_image(language)
         if image:
             context.bot.send_photo(chat_id=chat_id, photo=image, caption=menu_message, reply_markup=menu_keyboard)
         else:
             context.bot.send_message(chat_id=update.callback_query.message.chat_id, text=menu_message,
                                      reply_markup=menu_keyboard)
     else:
         if update.message:
             update.message.reply_text(menu_message, reply_markup=menu_keyboard)
         else:
             context.bot.send_message(chat_id=update.callback_query.message.chat_id, text=menu_message,
                                      reply_markup=menu_keyboard)
Ejemplo n.º 6
0
def news(update, context):
    context.user_data['user'] = users.user_exists(update.message.from_user.id)
    if context.user_data['user'].get('is_blocked'):
        blocked_message = strings.get_string(
            'blocked', context.user_data['user'].get('language'))
        update.message.reply_text(blocked_message)
        return
    if context.user_data['user'].get('language') == 'uz':
        news_message = settings.get_settings().get('news_uz')
    else:
        news_message = settings.get_settings().get('news')
    news_message = utils.replace_new_line(news_message)
    news_keyboard = keyboards.get_keyboard(
        'news', language=context.user_data['user'].get('language'))
    image = images.get_news_image()
    if image:
        chat_id = update.message.chat_id
        message = context.bot.send_photo(chat_id=chat_id,
                                         photo=image,
                                         caption=news_message,
                                         parse_mode=ParseMode.HTML,
                                         reply_markup=news_keyboard)
    else:
        message = update.message.reply_text(text=news_message,
                                            parse_mode=ParseMode.HTML,
                                            reply_markup=news_keyboard)
    if 'news_message_id' in context.user_data:
        try:
            context.bot.delete_message(
                chat_id=update.message.chat_id,
                message_id=context.user_data['news_message_id'])
        except BadRequest:
            pass
    context.user_data['news_message_id'] = message.message_id
Ejemplo n.º 7
0
def create(update, context):
    context.user_data['user'] = users.user_exists(
        update.callback_query.from_user.id)
    if context.user_data['user'].get('is_blocked'):
        blocked_message = strings.get_string(
            'blocked', context.user_data['user'].get('language'))
        update.callback_query.answer(text=blocked_message, show_alert=True)
        return ConversationHandler.END
    context.user_data['has_action'] = True
    query = update.callback_query
    context.user_data['resume'] = {}
    context.user_data['resume']['user_id'] = query.from_user.id
    language = context.user_data['user'].get('language')
    query.answer(text=strings.get_string('resumes.menu_has_gone', language),
                 show_alert=True)
    message = strings.get_string('resumes.create.title', language)
    keyboard = keyboards.get_keyboard('go_back.one_time', language)
    context.bot.delete_message(chat_id=query.from_user.id,
                               message_id=query.message.message_id)
    if 'catalog_photo_id' in context.user_data:
        try:
            context.bot.delete_message(
                chat_id=update.effective_chat.id,
                message_id=context.user_data['catalog_photo_id'])
        except BadRequest:
            pass
    context.bot.send_message(chat_id=query.from_user.id,
                             text=message,
                             reply_markup=keyboard,
                             parse_mode=ParseMode.HTML)
    return TITLE
Ejemplo n.º 8
0
def _to_vacations(update: Update, context: CallbackContext):
    def sort_vacations_by_price(vacation: dict):
        result = re.search(r'\d+', vacation.get('price'))
        if result:
            return int(result.group())
        return vacation['price']

    query = update.callback_query
    language = context.user_data['user'].get('language')
    vacations = context.user_data['catalog']['vacations']
    location_code = context.user_data['catalog']['location']['code']
    category = context.user_data['current_category']
    if location_code != 'all':
        vacations = [
            vacation for vacation in vacations
            if vacation.get('location') == location_code
            or vacation.get('location') == 'all'
        ]
    if not vacations:
        empty_message = strings.get_string('catalog.empty', language)
        query.answer(text=empty_message, show_alert=True)
        return LOCATION_CITY
    vacations = sorted(vacations, key=sort_vacations_by_price)
    vacations_message = strings.from_vacations_list_message(
        vacations,
        category, context.user_data['catalog']['location']['full_name'],
        len(vacations), language)
    catalog_keyboard = keyboards.get_keyboard('catalog.vacations', language)
    query.edit_message_text(vacations_message,
                            reply_markup=catalog_keyboard,
                            parse_mode=ParseMode.HTML)
    return VACATIONS
Ejemplo n.º 9
0
def account_settings(update: Update, context: CallbackContext):
    context.user_data['user'] = users.user_exists(
        update.callback_query.from_user.id)
    language = context.user_data['user'].get('language')
    query = update.callback_query
    settings_keyboard = keyboards.get_keyboard('account.settings', language)
    query.edit_message_reply_markup(settings_keyboard)
Ejemplo n.º 10
0
def languages(update: Update, context):
    def error():
        languages_message = strings.get_string('start.languages')
        keyboard = keyboards.get_keyboard('start.languages')
        update.message.reply_text(languages_message, reply_markup=keyboard)

    text = update.message.text
    if strings.get_string('languages.ru') in text:
        language = 'ru'
    elif strings.get_string('languages.uz') in text:
        language = 'uz'
    else:
        error()
        return LANGUAGES
    user = update.message.from_user
    user_name = _get_user_name(user)
    users.create_user(user.id,
                      user_name,
                      user.username,
                      language,
                      referral_from_id=context.user_data.get(
                          'referral_from_id', None))
    help_message = strings.get_string('start.help', language)
    remove_keyboard = keyboards.get_keyboard('remove')
    update.message.reply_text(help_message, reply_markup=remove_keyboard)
    Navigation.to_account(update, context, new_message=True)
    return ConversationHandler.END
Ejemplo n.º 11
0
def vacation_price(update, context):
    language = context.user_data['user'].get('language')
    if update.callback_query and update.callback_query.data == 'back':
        message = strings.get_string('vacations.create.title', language)
        keyboard = keyboards.get_keyboard('go_back.inline', language)
        update.callback_query.edit_message_text(text=message,
                                                parse_mode=ParseMode.HTML,
                                                reply_markup=keyboard)
        return TITLE
    context.user_data['vacation']['price'] = update.message.text
    message = strings.get_string('vacations.create.name', language)
    keyboard = keyboards.get_keyboard('go_back.inline', language)
    update.message.reply_text(message,
                              parse_mode=ParseMode.HTML,
                              reply_markup=keyboard)
    return NAME
Ejemplo n.º 12
0
def update_vacation(update, context):
    message = update.message

    def go_back():
        vacation_message = strings.get_string(
            'vacations.edit', language).format(
                context.user_data['editing_vacation'].get('title'))
        edit_keyboard = keyboards.get_keyboard('vacation.edit', language)
        if 'vacation_edit_message' in context.user_data:
            context.bot.delete_message(
                chat_id=message.chat_id,
                message_id=context.user_data['vacation_edit_message'])
            del context.user_data['vacation_edit_message']
        context.bot.delete_message(chat_id=message.chat_id,
                                   message_id=message.message_id)
        message.reply_text(text=vacation_message,
                           reply_markup=edit_keyboard,
                           parse_mode=ParseMode.HTML)
        return EDIT_ACTION

    language = context.user_data['user'].get('language')
    if strings.get_string('go_back', language) in message.text:
        return go_back()
    payload = {context.user_data['editing_vacation_step']: message.text}
    context.user_data['editing_vacation'] = vacations.update_vacation(
        context.user_data['editing_vacation']['id'], payload)
    success_message = strings.get_string('success', language)
    menu_keyboard = keyboards.get_keyboard('menu', language)
    message.reply_text(text=success_message, reply_markup=menu_keyboard)
    return go_back()
Ejemplo n.º 13
0
def rating(update, context):
    query = update.callback_query
    language = context.user_data['user'].get('language')
    referral_rating = referral.get_top_referrals(
        context.user_data['referral_tender'].get('id'))
    rating_message = strings.from_referral_rating(referral_rating, language)
    keyboard = keyboards.get_keyboard('referral.rating', language)
    query.edit_message_caption(caption=rating_message, reply_markup=keyboard)
Ejemplo n.º 14
0
def referral_rules(update, context):
    query = update.callback_query
    language = context.user_data['user'].get('language')
    rules_message = strings.from_referral_rules(
        context.user_data['referral_tender'], language)
    keyboard = keyboards.get_keyboard('referral.rules', language)
    query.edit_message_text(text=rules_message,
                            reply_markup=keyboard,
                            parse_mode=ParseMode.HTML)
Ejemplo n.º 15
0
def prize_places(update, context):
    query = update.callback_query
    language = context.user_data['user'].get('language')
    prize_message = strings.from_referral_prize_places(
        context.user_data['referral_tender'], language)
    keyboard = keyboards.get_keyboard('referral.prize', language)
    query.edit_message_caption(caption=prize_message,
                               reply_markup=keyboard,
                               parse_mode=ParseMode.HTML)
Ejemplo n.º 16
0
def _to_location_region(update: Update, context: CallbackContext):
    message = update.message
    language = context.user_data['user'].get('language')
    select_location_message = strings.get_string('location.regions', language)
    select_location_keyboard = keyboards.get_keyboard('location.regions',
                                                      language)
    image = images.get_catalog_image(language)
    update.callback_query.edit_message_text(
        text=select_location_message, reply_markup=select_location_keyboard)
    return LOCATION_REGION
Ejemplo n.º 17
0
def edit(update, context):
    query = update.callback_query
    language = context.user_data['user'].get('language')
    message = strings.get_string('resumes.edit', language).format(
        context.user_data['editing_resume'].get('title'))
    edit_keyboard = keyboards.get_keyboard('resume.edit', language)
    query.edit_message_text(text=message,
                            reply_markup=edit_keyboard,
                            parse_mode=ParseMode.HTML)
    return EDIT_ACTION
Ejemplo n.º 18
0
 def go_back():
     resume_message = strings.get_string('resumes.edit', language).format(
         context.user_data['editing_resume'].get('title'))
     Navigation.to_main_menu(
         update, language, user_name=context.user_data['user'].get('name'))
     edit_keyboard = keyboards.get_keyboard('resume.edit', language)
     message.reply_text(text=resume_message,
                        reply_markup=edit_keyboard,
                        parse_mode=ParseMode.HTML)
     return EDIT_ACTION
Ejemplo n.º 19
0
 def run(self, **kwargs):
     bot = kwargs.get('bot')
     notifiable_users = kwargs.get('notifiable_users')
     string_resource = kwargs.get('string_resource')
     for user in notifiable_users:
         message = strings.get_string(string_resource, user.get('language'))
         keyboard = keyboards.get_keyboard('notifications.close', user.get('language'))
         try:
             bot.send_message(chat_id=user.get('id'), text=message, reply_markup=keyboard)
         except BadRequest:
             continue
Ejemplo n.º 20
0
def from_location_to_contacts(update, context):
    language = context.user_data['user'].get('language')
    context.bot.delete_message(
        chat_id=update.callback_query.message.chat_id,
        message_id=context.user_data['location_message_id'])
    message = strings.get_string('vacations.create.contacts', language)
    keyboard = keyboards.get_keyboard('go_back.one_time', language)
    context.bot.send_message(chat_id=update.callback_query.message.chat_id,
                             text=message,
                             reply_markup=keyboard,
                             parse_mode=ParseMode.HTML)
    return CONTACTS
Ejemplo n.º 21
0
def vacation_contacts(update, context):
    language = context.user_data['user'].get('language')
    if strings.get_string('go_back', language) in update.message.text:
        message = strings.get_string('vacations.create.description', language)
        update.message.reply_text(message, parse_mode=ParseMode.HTML)
        return DESCRIPTION
    context.user_data['vacation']['contacts'] = update.message.text
    message = strings.get_string('location.regions', language)
    keyboard = keyboards.get_keyboard('location.regions', language)
    remove_keyboard = keyboards.get_keyboard('remove')
    remove_message = strings.get_string('remove_keyboard', language)
    removed_message = context.bot.send_message(chat_id=update.message.chat_id,
                                               text=remove_message,
                                               reply_markup=remove_keyboard,
                                               disable_notification=True)
    context.bot.delete_message(chat_id=update.message.chat_id,
                               message_id=removed_message.message_id)
    message = update.message.reply_text(message, reply_markup=keyboard)
    context.user_data['location_message_id'] = message.message_id
    context.user_data['location_step'] = 'region'
    return REGION
Ejemplo n.º 22
0
def from_categories_to_location(update, context):
    language = context.user_data['user'].get('language')
    context.bot.delete_message(
        chat_id=update.callback_query.from_user.id,
        message_id=context.user_data['categories_message_id'])
    message = strings.get_string('location.regions', language)
    keyboard = keyboards.get_keyboard('location.regions', language)
    message = context.bot.send_message(
        chat_id=update.callback_query.from_user.id,
        text=message,
        reply_markup=keyboard)
    context.user_data['location_message_id'] = message.message_id
    return REGION
Ejemplo n.º 23
0
def resume_price(update, context):
    language = context.user_data['user'].get('language')
    if strings.get_string('go_back', language) in update.message.text:
        message = strings.get_string('resumes.create.title', language)
        update.message.reply_text(message, parse_mode=ParseMode.HTML)
        return TITLE
    context.user_data['resume']['price'] = update.message.text
    message = strings.get_string('resumes.create.name', language)
    keyboard = keyboards.get_keyboard('go_back.one_time', language)
    update.message.reply_text(message,
                              parse_mode=ParseMode.HTML,
                              reply_markup=keyboard)
    return NAME
Ejemplo n.º 24
0
def vacation_title(update, context):
    language = context.user_data['user'].get('language')
    if update.callback_query and update.callback_query.data == 'back':
        del context.user_data['vacation']
        Navigation.to_account(update, context)
        del context.user_data['has_action']
        return ConversationHandler.END
    context.user_data['vacation']['title'] = update.message.text
    message = strings.get_string('vacations.create.price', language)
    keyboard = keyboards.get_keyboard('go_back.inline', language)
    update.message.reply_text(message,
                              parse_mode=ParseMode.HTML,
                              reply_markup=keyboard)
    return PRICE
Ejemplo n.º 25
0
def referral_start(update: Update, context):
    user = users.user_exists(update.message.from_user.id)
    if user:
        if user.get('is_blocked'):
            blocked_message = strings.get_string('blocked',
                                                 user.get('language'))
            update.message.reply_text(blocked_message)
            return ConversationHandler.END
        welcome_message = strings.get_string(
            'start.welcome', user.get('language')).format(
                username=_get_user_name(update.effective_user))
        remove_keyboard = keyboards.get_keyboard('remove')
        update.message.reply_text(welcome_message,
                                  reply_markup=remove_keyboard)
        Navigation.to_account(update, context, new_message=True)
        return ConversationHandler.END
    if context.args:
        context.user_data['referral_from_id'] = context.args[0]
    languages_message = strings.get_string('start.languages')
    keyboard = keyboards.get_keyboard('start.languages')

    update.message.reply_text(languages_message, reply_markup=keyboard)

    return LANGUAGES
Ejemplo n.º 26
0
def change_language(update, context):
    context.user_data['user'] = users.user_exists(
        update.callback_query.from_user.id)
    if context.user_data['user'].get('is_blocked'):
        blocked_message = strings.get_string(
            'blocked', context.user_data['user'].get('language'))
        update.callback_query.answer(text=blocked_message, show_alert=True)
        return
    query = update.callback_query
    query.answer()
    language = context.user_data['user'].get('language')
    change_language_message = strings.get_string('account.select_language',
                                                 language)
    keyboard = keyboards.get_keyboard('account.language', language)
    query.edit_message_caption(change_language_message, reply_markup=keyboard)
Ejemplo n.º 27
0
def to_referral_tender(update, context):
    user_id = update.callback_query.from_user.id
    query = update.callback_query
    language = context.user_data['user'].get('language')
    invited_users = referral.get_invited_users(
        user_id, context.user_data['referral_tender'].get('id'))
    link = helpers.create_deep_linked_url(context.bot.get_me().username,
                                          str(user_id))
    referral_message = strings.from_referral_tender(
        context.user_data['referral_tender'], language, len(invited_users),
        link)
    referral_keyboard = keyboards.get_keyboard('referral', language)
    query.edit_message_caption(caption=referral_message,
                               reply_markup=referral_keyboard,
                               parse_mode=ParseMode.HTML)
    return ConversationHandler.END
Ejemplo n.º 28
0
 def go_back():
     vacation_message = strings.get_string(
         'vacations.edit', language).format(
             context.user_data['editing_vacation'].get('title'))
     edit_keyboard = keyboards.get_keyboard('vacation.edit', language)
     if 'vacation_edit_message' in context.user_data:
         context.bot.delete_message(
             chat_id=message.chat_id,
             message_id=context.user_data['vacation_edit_message'])
         del context.user_data['vacation_edit_message']
     context.bot.delete_message(chat_id=message.chat_id,
                                message_id=message.message_id)
     message.reply_text(text=vacation_message,
                        reply_markup=edit_keyboard,
                        parse_mode=ParseMode.HTML)
     return EDIT_ACTION
Ejemplo n.º 29
0
def vacation_city(update, context):
    language = context.user_data['user'].get('language')
    query = update.callback_query
    city = query.data.split(':')[1]
    if city == 'back':
        message = strings.get_string('location.regions', language)
        keyboard = keyboards.get_keyboard('location.regions', language)
        query.answer()
        query.edit_message_text(text=message, reply_markup=keyboard)
        return REGION
    region = context.user_data['vacation']['location']['region']
    city_name = strings.get_city_from_region(region, city, language)
    region_name = strings.get_string('location.regions.' + region, language)
    full_name = region_name + ', ' + city_name
    context.user_data['vacation']['location']['full_name'] = full_name
    context.user_data['vacation']['location']['code'] = region + '.' + city
    query.answer(text=full_name)
    return to_parent_categories(query, context)
Ejemplo n.º 30
0
def resume(update, context):
    context.user_data['user'] = users.user_exists(
        update.callback_query.from_user.id)
    if context.user_data['user'].get('is_blocked'):
        blocked_message = strings.get_string(
            'blocked', context.user_data['user'].get('language'))
        update.callback_query.answer(text=blocked_message, show_alert=True)
        return ConversationHandler.END
    context.user_data['has_action'] = True
    language = context.user_data['user'].get('language')
    query = update.callback_query
    resume_id = query.data.split(':')[1]
    resume = resumes.get_resume(resume_id)
    context.user_data['editing_resume'] = resume
    resume_message = strings.from_resume(resume, language)
    resume_keyboard = keyboards.get_keyboard('resume', language)
    query.edit_message_text(text=resume_message, reply_markup=resume_keyboard)
    return RESUME_ACTION