예제 #1
0
        public async void Weather(MessageEventArgs messageEventArgs)
        {
            var weather = await WeatherHelper.GetWeather(User.GetLanguage);

            var inlineKeyboard = TemplateModelsBuilder.RefreshWeather(User.GetLanguage);

            SendMessageAsync(ChatId, weather, ParseMode.Markdown, replyMarkup: inlineKeyboard);
        }
예제 #2
0
        //Refresh weather
        public async void RefreshWeather(CallbackQueryEventArgs callbackQueryEventArgs)
        {
            var  args   = ArgParser.ParseCallbackData(callbackQueryEventArgs.CallbackQuery.Data);
            bool isEdit = args.ContainsKey(Commands.IsEdit);

            var weather = await WeatherHelper.GetWeather(User.GetLanguage);

            var inlineKeyboard = TemplateModelsBuilder.RefreshWeather(User.GetLanguage);

            if (isEdit)
            {
                EditMessageTextAsync(ChatId, MessageId, weather, ParseMode.Markdown, replyMarkup: inlineKeyboard);
            }
            else
            {
                SendMessageAsync(ChatId, weather, ParseMode.Markdown, replyMarkup: inlineKeyboard);
            }
        }