예제 #1
0
        public async Task Execute(Update update)
        {
            string chatIdToBeDeleted = update.Message.Chat.Id.ToString();

            try
            {
                await _repo.DeleteChat(chatIdToBeDeleted);

                await _client.SendTextMessageAsync(chatIdToBeDeleted, StandardMessages.ChatDeletionSuccess);
            }
            catch (DataAccessException exc)
            {
                await _client.SendTextMessageAsync(chatIdToBeDeleted, exc.Message);
            }
            catch (Exception exc)
            {
                _logger.LogError(exc, "Were not able to delete chat");
            }
        }