From b770be09a42dc600bd805b52e1e14da6536d3b3a Mon Sep 17 00:00:00 2001 From: omarm Date: Tue, 18 Apr 2017 11:14:19 +0300 Subject: [PATCH] tell user max length --- TeleSharp.TL/TL/TLInputMediaUploadedDocument.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/TeleSharp.TL/TL/TLInputMediaUploadedDocument.cs b/TeleSharp.TL/TL/TLInputMediaUploadedDocument.cs index 89f3e87..bad8720 100644 --- a/TeleSharp.TL/TL/TLInputMediaUploadedDocument.cs +++ b/TeleSharp.TL/TL/TLInputMediaUploadedDocument.cs @@ -31,7 +31,14 @@ namespace TeleSharp.TL } set { - caption = value.Length > 200 ? value.Remove(199, value.Length - 199) : value; + if (value.Length > 200) + { + throw new System.ArgumentException("too long caption plase make it less than 200 char"); + } + else + { + caption = value; + } } } public TLVector stickers {get;set;}