예제 #1
0
        public async Task Execude(Update update, TelegramBotClient bot)
        {
            try
            {
                var quote = _quoteService.Get();
                await bot.SendTextMessageAsync(update.Message.Chat.Id, String.Format($"{quote.QuoteText} Aвтор: {quote.QuoteAuthor}"));

                _log.Information(String.Format($"{quote.QuoteText} Aвтор: {quote.QuoteAuthor}"));
            }
            catch (WeatherException ex)
            {
                await bot.SendTextMessageAsync(update.Message.Chat.Id, "Ошибка получения цитаты");

                _log.Information("Ошибка получения цитаты");
            }
        }
예제 #2
0
 public ActionResult <List <Quote> > Get()
 {
     return(_service.Get());
 }
예제 #3
0
 public ActionResult <List <Quote> > Get() =>
 _quoteService.Get();