0

i using some code to make channelpost "Hello Word"

string urlString = "https://api.telegram.org/bot{0}/sendMessage?chat_id={1}&text={2}";
                string apiToken = "1143035780:AAEG5vU5j2_Nc5rLK8B2ORp3ItpYoNicokU";
                string chatId = "@kekcheburekks";
                string text = "Hello world!";
                urlString = String.Format(urlString, apiToken, chatId, text);
                WebRequest request = WebRequest.Create(urlString);
                Stream rs = request.GetResponse().GetResponseStream();
                StreamReader reader = new StreamReader(rs);
                string line = "";
                StringBuilder sb = new StringBuilder();
                while (line != null)
                {
                    line = reader.ReadLine();
                    if (line != null)
                        sb.Append(line);
                }
                string response = sb.ToString();

But i am get exception - chatId not found!

Stefan
  • 17,448
  • 11
  • 60
  • 79

1 Answers1

0

I think the problem is when you pass @ symbol, try without it, like this:

string chatId = "kekcheburekks";

Without using @ like this:

string chatId = "@kekcheburekks";   
Muaath
  • 579
  • 3
  • 19