Ejemplo n.º 1
0
        /// <summary>
        /// Processes incoming webhook request (deserializes from stream and calls <see cref="ProcessUpdateSafelyAsync(Update)"/>)
        /// </summary>
        /// <param name="stream">Request stream (with Updates)</param>
        /// <returns>Awaitable Task</returns>
        public virtual async Task ProcessIncomingWebhookAsync(Stream stream)
        {
            using (var reader = new StreamReader(stream))
            {
                var text = await reader.ReadToEndAsync();

                var update = botApi.DeserializeUpdate(text);
                await ProcessUpdateAsync(update);
            }
        }