Пример #1
0
        public async Task <string> GetTelegramFile(string accessHash, string id, int version, int size, string type)
        {
            try
            {
                var buffer = await _telegramService.GetFileAsync(
                    long.Parse(accessHash), long.Parse(id), version, size);

                string base64String = Convert.ToBase64String(buffer, 0, buffer.Length);
                return("data:" + type + ";base64," + base64String);
            }
            catch { }
            return(null);
        }