예제 #1
0
        public async Task Handle(Message message)
        {
            var document = message.Document;

            //if (document.FileSize > _telegramConfig.MaxFileSizeKbs)
            //    throw new NotSupportedException($"Files bigger than {_telegramConfig.MaxFileSizeKbs} KBs not supported");

            Console.WriteLine($"Filesize: {document.FileSize}");

            var documentStream = await _telegramClient.FetchFile(message.Document.FileId);

            await _amazonS3Proxy.PutObject(documentStream);

            documentStream.Close();

            await _documentRepostiory.Add();
        }