New line for title in Telegram Bot Api Library (.Net)

I am using Telegram Bot Api Library ( link ) (version 13.0.1.0) in my Asp.Net project.

I use the code to send a caption image to my channel.

var sb = new StringBuilder();
sb.AppendLine("line1 ");
sb.AppendLine("line2 ");
sb.AppendLine("line3 ");

bot.SendPhotoAsync("@" + channel.Name, fileToSend, sb.ToString(), false, 0);

But my problem is that my new line is not displayed on the output

enter image description here

How to solve this problem and correctly display a new line in the output?

[solvable]

this is a bug of this library and with updating to 13.2.0 the problem is solved.

+4
source share
2 answers

can use '\ n':

string a = "First Line \n Second Line \n Third Line";
0
source

"\n" HttpUtility.UrlEncode(YourText) , (hastag #)

    string TextCaption = "First Line \n Second Line \n Third Line \n....";
    bot.SendPhotoAsync("@" + channel.Name, fileToSend, HttpUtility.UrlEncode(TextCaption ), false, 0);
0

Source: https://habr.com/ru/post/1682716/


All Articles