You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 5, 2021. It is now read-only.
Hi everyone,
I'm using Tl sharp to create a channel message receiver.
and I have a problem about receiving and saving Photo Files.
I checked out official tlsharp code sample to get document files bud I want to save photo files using client.get(); method.
this is the code sample for ducument files:
How can I use this code for getting and saving Photo files?
var client = NewClient();
await client.ConnectAsync();
var result = await client.GetContactsAsync();
var user = result.Users
.OfType<TLUser>()
.FirstOrDefault(x => x.Phone == NumberToSendMessage);
var inputPeer = new TLInputPeerUser() { UserId = user.Id };
var res = await client.SendRequestAsync<TLMessagesSlice>(new TLRequestGetHistory() { Peer = inputPeer });
var document = res.Messages
.OfType<TLMessage>()
.Where(m => m.Media != null)
.Select(m => m.Media)
.OfType<TLMessageMediaDocument>()
.Select(md => md.Document)
.OfType<TLDocument>()
.First();
var resFile = await client.GetFile(
new TLInputDocumentFileLocation()
{
AccessHash = document.AccessHash,
Id = document.Id,
Version = document.Version
},
document.Size);
The text was updated successfully, but these errors were encountered:
Hi everyone,
I'm using Tl sharp to create a channel message receiver.
and I have a problem about receiving and saving Photo Files.
I checked out official tlsharp code sample to get document files bud I want to save photo files using client.get(); method.
this is the code sample for ducument files:
How can I use this code for getting and saving Photo files?
The text was updated successfully, but these errors were encountered: