Exemple #1
0
def get_weather(update, context):
    weather_type = context.user_data['weather']['weather_type']
    airport_name = update.message.text.lower()
    if not airport_name or airport_name not in airports_icao_codes.keys():
        update.message.reply_text('Не удалось определить ICAO-код аэропорта',
                                  reply_markup=create_keyboard('airports'))
        return 'choose_airport'
    weather = process_weather_handlers(airport_name, weather_type)
    if weather:
        update.message.reply_text(weather,
                                  reply_markup=create_keyboard('main'))
        return ConversationHandler.END
    return 'get_weather'
Exemple #2
0
 def our_choice(self, call):
     return utils.create_keyboard(utils.our_choice(call))
Exemple #3
0
 def city(self, call):
     return utils.create_keyboard(utils.city(call))
Exemple #4
0
 def state(self, call):
     return utils.create_keyboard(utils.state(call))
Exemple #5
0
 def country(self):
     return utils.create_keyboard(utils.country())
Exemple #6
0
def weather_dontknow(update, context):
    update.message.reply_text('Я вас не понимаю, используйте клавиатуру',
                              reply_markup=create_keyboard('weather_type'))
Exemple #7
0
def greet_user(update, context):
    context.user_data['emoji'] = get_smile(context.user_data)
    update.message.reply_text(
        f'Здравствуй, пользователь! {context.user_data["emoji"]}',
        reply_markup=create_keyboard('main'))