1
嗨,我正在與我的應用程序的電報機器人同步和發送帶有標題的圖像。我在電報bot上發送圖像時獲得了成功。但是當我發送圖像的長標題時,一半的圖像沒有通過。我不知道標題或文本的任何限制是否在電報上發送,我不知道它。請任何人知道然後請告訴我。我想要發送帶圖像的完整標題。我的標題很長,然後我想製作標題的2部分併發送。在這裏下面我已經嘗試像這樣的代碼。如何使用c#發送大尺寸的電報機器人上的標題?
這是我的API =>
[System.Web.Http.AcceptVerbs("POST")]
public void SendCasesOnTelegramBot()
{
try
{
DataSet ds = DataAccess.ExecuteDataset(Setting.ConnectionString(), "GetPostForTelegramBot");
if (ds != null && ds.Tables.Count > 0)
{
if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
{
var Image = ds.Tables[0].Rows[0]["Url"].ToString();
byte[] imageData = null;
WebClient webClient = new WebClient();
imageData = webClient.DownloadData(Image);
MemoryStream ms = new MemoryStream(imageData);
var sb = new StringBuilder();
sb.Append(Environment.NewLine);
sb.Append(".");
sb.Append(Environment.NewLine);
sb.Append(".");
sb.Append(Environment.NewLine);
if (ds.Tables[0].Rows[0]["Description"].ToString().Length <= 133)
{
sb.AppendLine(ds.Tables[0].Rows[0]["Description"].ToString());
}
else
{
sb.AppendLine(ds.Tables[0].Rows[0]["Description"].ToString().Substring(0, 133));
sb.AppendLine(ds.Tables[0].Rows[0]["Description"].ToString().Substring(134, 0));
}
sb.Append(Environment.NewLine);
sb.Append("join our team...");
Bot.SendPhotoAsync("@abc", new FileToSend(ds.Tables[0].Rows[0]["Url"].ToString(), ms), sb.ToString());
}
}
}
catch (Exception ex)
{
}
}
這是我的標題=>
**it is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).**
任何一個請幫助我,我沒有想法如何能做到這一點。
您不能設置具有超過200個字符的標題。您可以發送一張照片,然後用包含所需長文本的短信回覆。 – tashakori
@tashakori所以它的限制有多達200個字符不在標題中設置? – Edit
是的,你不能在標題中包含那麼長的文字。 – tashakori