예제 #1
0
        /// <summary>
        /// Chanages chat name and sends a service message on it.
        /// </summary>
        /// <param name="chatId">Chat's identifier</param>
        /// <param name="title">New chat name, different from the old one</param>
        /// <returns>
        /// Returns a <see cref="IUpdates"/> object containing a service message sent during an action.
        /// </returns>
        public async Task <IUpdates> EditChatTitle(int chatId, string title)
        {
            EnsureUserAuthorized();

            var request = new RequestEditChatTitle {
                ChatId = chatId, Title = title
            };

            return(await SenderService.SendRequestAsync(request).ConfigureAwait(false));
        }
예제 #2
0
        /// <inheritdoc />
        public async Task <IUpdates> EditChatTitle(int chatId, string title, CancellationToken cancellationToken = default(CancellationToken))
        {
            ClientSettings.EnsureUserAuthorized();

            var request = new RequestEditChatTitle
            {
                ChatId = chatId,
                Title  = title
            };

            return(await RequestSender.SendRequestAsync(request, cancellationToken).ConfigureAwait(false));
        }