Exemple #1
0
def startuper_final_q(update, context):
    lang = language(update)
    answer = update.message.text
    chat_id = update.effective_chat.id
    save_user(chat_id)
    if answer == c.text['final_option'][lang]:
        context.bot.send_message(text=c.text['final_answer'][lang], chat_id=update.effective_chat.id)
        return main_menu(update, context)
    elif answer == c.text['to_main_menu'][lang]:
        return main_menu(update, context)
    else:
        return unknown_command(update, context)
Exemple #2
0
def try_again_or_mm(update, context): # try again(go to question about tech) or move to main menu
    lang = language(update)
    answer = update.message.text
    if answer == c.text['try_again'][lang]:
        return tech_yes_no(update, context)
    elif answer == c.text['to_main_menu'][lang]:
        return main_menu(update, context)
    else:
        return unknown_command(update, context)
Exemple #3
0
def about_yangel_handler(update, context):
    lang = language(update)
    answer = update.message.text
    if answer == c.text['first_menu']['first_option'][lang]:
        return main_menu(update, context)
    elif answer == c.text['first_menu']['second_option'][lang]:
        update.message.reply_text(text='http://yangelspace.tech')
    else:
        return unknown_command(update, context)
Exemple #4
0
def about_yangel_handler(update, context):
    lang = language(update)
    answer = update.message.text
    if answer == c.text['first_menu']['first_option'][lang]:
        return main_menu(update, context)
    elif answer == c.text['first_menu']['second_option'][lang]:
        context.bot.send_message(text='http://www.nkau.gov.ua',
                                 chat_id=update.effective_chat.id)
    else:
        return unknown_command(update, context)
Exemple #5
0
def q_round_yes_no(update, context):
    lang = language(update)
    answer = update.message.text
    if answer == c.text['yes'][lang]:
        context.bot.send_message(chat_id=update.effective_chat.id, text=c.text['startup_ans']['fifth'][lang])
        update.message.reply_text(text=c.text['startup_blank_q']['name'][lang], reply_markup=ReplyKeyboardRemove())
        return STARTUPER_NAME ##################################### fill the blank
    elif answer == c.text['to_main_menu'][lang]:
        return main_menu(update, context)
    else:
        return unknown_command(update, context)
Exemple #6
0
def partner_handler(update, context):
    lang = language(update)
    answer = update.message.text
    if answer == c.text['partner_opt'][lang]:
        context.bot.send_message(chat_id=update.effective_chat.id, text=c.text['partner_q']['answer'][lang])
        update.message.reply_text(text=c.text['partner_q']['name'][lang], reply_markup=ReplyKeyboardRemove())
        return PARTNER_NAME
    elif answer == c.text['to_main_menu'][lang]:
        return main_menu(update, context)
    else:
        return unknown_command(update, context)
Exemple #7
0
def tech_q(update, context): #takes the answer from the prev question, if answer is 'let's go' - makes two buttons: yes
    lang = language(update) # or no, and sends the next question, then returns the answer of this question
    answer = update.message.text
    if answer == c.text['lets_go'][lang]:
        context.bot.send_message(chat_id=update.effective_chat.id, text=c.text['startup_ans']['first'][lang])
        reply_keyboard = [[c.text['yes'][lang], c.text['no'][lang]]]
        markup = ReplyKeyboardMarkup(reply_keyboard, resize_keyboard=True)#, one_time_keyboard=True)
        update.message.reply_text(text=c.text['startup_q']['tech'][lang], reply_markup=markup)
        return TECH_YES_NO
    elif answer == c.text['back'][lang]:
        return main_menu(update, context)
    else:
        return unknown_command(update, context)
Exemple #8
0
def admin_handler(update, context):
    lang = language(update)
    answer = update.message.text
    if answer == c.text['options_admin']['push'][lang]:
        update.message.reply_text(text=c.text['push_text_q'][lang],
                                  reply_markup=ReplyKeyboardRemove())
        return PUSH_TEXT
    elif answer == c.text['options_admin']['stats'][lang]:
        return stats_handler(update, context)
    elif answer == c.text['to_main_menu'][lang]:
        return main_menu(update, context)
    else:
        return unknown_command(update, context)
Exemple #9
0
def admin_handler(update, context):
    lang = language(update)
    answer = update.message.text
    if answer == c.text['options_admin']['push'][lang]:
        update.message.reply_text(text=c.text['push_text_q'][lang],
                                  reply_markup=ReplyKeyboardRemove())
        return PUSH_TEXT
    elif answer == c.text['options_admin']['stats'][lang]:
        return stats_handler(update, context)
    elif answer == c.text['options_admin']['update'][lang]:
        facts = updateFact()
        msg = c.text['options_admin']['update_text'][lang]
        update.message.reply_text(msg.format(facts=facts),
                                  disable_web_page_preview=True)
    elif answer == c.text['to_main_menu'][lang]:
        return main_menu(update, context)
    else:
        return unknown_command(update, context)