Esempio n. 1
0
        public async Task Execute(Update update)
        {
            string chatId = update.Message.Chat.Id.ToString();

            try
            {
                var schedule = await _repo.GetScheduleForChat(chatId);

                string content  = JsonConvert.SerializeObject(schedule);
                string fileName = schedule.Name + "Schedule";
                await _client.SendTextFileAsync(chatId, content, fileName);
            }
            catch (DataAccessException ex)
            {
                await _client.SendTextMessageAsync(chatId, ex.Message);
            }
        }