diff --git a/.github/dev.yml b/.github/dev.yml index b80f31d..611e374 100644 --- a/.github/dev.yml +++ b/.github/dev.yml @@ -1,7 +1,7 @@ pr: none trigger: [ master ] -name: 4.0.0-dev.$(Rev:r) +name: 4.0.1-dev.$(Rev:r) pool: vmImage: ubuntu-latest diff --git a/.github/release.yml b/.github/release.yml index 47e6a28..4c8040d 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -1,7 +1,7 @@ pr: none trigger: none -name: 4.0.0 +name: 4.0.$(Rev:r) pool: vmImage: ubuntu-latest diff --git a/src/TL.Xtended.cs b/src/TL.Xtended.cs index 6726515..28d04ed 100644 --- a/src/TL.Xtended.cs +++ b/src/TL.Xtended.cs @@ -327,6 +327,7 @@ namespace TL protected override InputPhoto ToInputPhoto() => new() { id = id, access_hash = access_hash, file_reference = file_reference }; public InputPhotoFileLocation ToFileLocation() => ToFileLocation(LargestPhotoSize); public InputPhotoFileLocation ToFileLocation(PhotoSizeBase photoSize) => new() { id = id, access_hash = access_hash, file_reference = file_reference, thumb_size = photoSize.Type }; + public InputDocumentFileLocation ToFileLocation(VideoSize videoSize) => new() { id = id, access_hash = access_hash, file_reference = file_reference, thumb_size = videoSize.type }; public PhotoSizeBase LargestPhotoSize => sizes.Aggregate((agg, next) => (long)next.Width * next.Height > (long)agg.Width * agg.Height ? next : agg); } @@ -507,6 +508,7 @@ namespace TL public string Filename => GetAttribute()?.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 InputDocumentFileLocation ToFileLocation(VideoSize videoSize) => new() { id = id, access_hash = access_hash, file_reference = file_reference, thumb_size = videoSize.type }; public PhotoSizeBase LargestThumbSize => thumbs?.Aggregate((agg, next) => (long)next.Width * next.Height > (long)agg.Width * agg.Height ? next : agg); public T GetAttribute() where T : DocumentAttribute => attributes.OfType().FirstOrDefault(); } @@ -733,4 +735,10 @@ namespace TL partial class Theme { public static implicit operator InputTheme(Theme theme) => new() { id = theme.id, access_hash = theme.access_hash }; } partial class GroupCallBase { public static implicit operator InputGroupCall(GroupCallBase call) => new() { id = call.ID, access_hash = call.AccessHash }; } + + partial class RequestedPeer { public abstract long ID { get; } } + partial class RequestedPeerUser { public override long ID => user_id; } + partial class RequestedPeerChat { public override long ID => chat_id; } + partial class RequestedPeerChannel { public override long ID => channel_id; } + }