Esempio n. 1
0
        /// <summary>
        /// Deletes a contact from the list.
        /// </summary>
        /// <param name="contact"></param>
        /// <returns></returns>
        public async Task <bool> DeleteContactAsync(Models.Contact contact)
        {
            await ConnectAsync();

            bool deleteSuccessfully = false;

            try
            {
                ContactsLink contactsLink = await _client.DeleteContact(new InputUserContactConstructor(contact.Id));

                deleteSuccessfully = true;
            }
            catch (TelegramReqestException ex)
            {
                _logger.Error($"The contact with id `{contact.Id}` can not be found in contacts", ex);
            }
            return(deleteSuccessfully);
        }