mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2025-12-06 06:52:01 +01:00
easier access to Document filename
This commit is contained in:
parent
f282d270ae
commit
a178d4be6f
|
|
@ -355,6 +355,8 @@ namespace TL
|
|||
partial class Document
|
||||
{
|
||||
public override long ID => id;
|
||||
public override string ToString() => Filename is string filename ? base.ToString() + ": " + filename : base.ToString();
|
||||
public string Filename => attributes.OfType<DocumentAttributeFilename>().FirstOrDefault()?.file_name;
|
||||
protected override InputDocument ToInputDocument() => new() { id = id, access_hash = access_hash, file_reference = file_reference };
|
||||
public InputDocumentFileLocation ToFileLocation(PhotoSizeBase thumbSize = null) => new() { id = id, access_hash = access_hash, file_reference = file_reference, thumb_size = thumbSize?.Type };
|
||||
public PhotoSizeBase LargestThumbSize => thumbs?.Aggregate((agg, next) => (long)next.Width * next.Height > (long)agg.Width * agg.Height ? next : agg);
|
||||
|
|
|
|||
Loading…
Reference in a new issue