Skip to content

Commit 4c0724b

Browse files
committed
implicit LinkPreviewOptions from an URL string
1 parent 6c33e31 commit 4c0724b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Telegram.Bot/Extend.Types.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ public partial class LinkPreviewOptions
171171
{
172172
/// <summary>To get the same behaviour as previous parameter <c>disableWebPagePreview:</c></summary>
173173
public static implicit operator LinkPreviewOptions(bool disabled) => new() { IsDisabled = disabled };
174+
/// <summary>Simply pass a URL string to request a preview of that link</summary>
175+
public static implicit operator LinkPreviewOptions(string url) => new() { Url = url };
174176
}
175177

176178
public partial class InputPollOption

0 commit comments

Comments
 (0)