예제 #1
0
def empty_message(message: telebot.types.Message):
    chat_id = message.chat.id
    user_id = message.from_user.id
    language = userservice.get_user_language(user_id)
    if userservice.is_user_registered(user_id):
        main_menu_message = strings.get_string('main_menu.choose_option', language)
        main_menu_keyboard = keyboards.get_keyboard('main_menu', language)
        telegram_bot.send_message(chat_id, main_menu_message, reply_markup=main_menu_keyboard)
예제 #2
0
def welcome(message):
    chat_id = message.chat.id
    user_id = message.from_user.id
    if userservice.is_user_registered(user_id):
        language = userservice.get_user_language(user_id)
        main_menu_message = strings.get_string('main_menu.choose_option',
                                               language)
        main_menu_keyboard = keyboards.get_keyboard('main_menu', language)
        telegram_bot.send_message(chat_id,
                                  main_menu_message,
                                  reply_markup=main_menu_keyboard)
        return
    welcome_text = strings.get_string('welcome')
    language_keyboard = keyboards.get_keyboard('welcome.language')
    msg = telegram_bot.send_message(chat_id,
                                    welcome_text,
                                    parse_mode='HTML',
                                    reply_markup=language_keyboard)
    telegram_bot.register_next_step_handler(msg, process_user_language)
예제 #3
0
def check_auth(message: Message):
    return userservice.is_user_registered(message.from_user.id)