I use Telegram Bot Api Library (link) (ver 13.0.1.0) in my Asp.Net project.
I use under code to send image with caption 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 newline don’t show in output
how can solve this problem and show new line correctly in output?
[Solved]
this is the bug of this library and with upgrade to 13.2.0 the problem solved.
3
Answers
using ‘n’ is possible :
using “n” and HttpUtility.UrlEncode(YourText)
this is best way for send text as text or caption if you want to put (hastag #)inside your text or caption
not when using .SendTextMessageAsync();
But OP’s original solution using StringBuilder() and .appendLine() worked perfectly for me. Much appreciated…had looked for a similar solution for long time.