コード例 #1
0
        public async Task <string> GetTelegramPhotoFileAsync(int localId, string secret, string volumeId, int size, string type)
        {
            try
            {
                var buffer = await _telegramService.GetPhotoFileAsync(localId, long.Parse(secret),
                                                                      long.Parse(volumeId), size);

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