asp.net

how to i send sendMessage method in Telegram using ASP?  #angularjs #reactjs

  • public class sendMessage { public string method { get { return “sendMessage”; }} public int chat_id { get; set; } public string text { get; set; } public string parse_mode { get; set; } public bool disable_web_page_preview { get; set; } public bool disable_notification { get; set; } public int reply_to_message_id { get; set; } public ReplyKeyboardMarkup reply_markup { get; set; } }
  • Stack Overflow works best with JavaScript enabled
  • I want send message with telegram bot, but I can’t send message when recieve json data with webhook.
  • WebException Message: The remote server returned an error: (502) Bad Gateway.
  • sign up log in tour help


@ng_real_ninja: how to i send sendMessage method in Telegram using ASP? #angularjs #reactjs

private void SendMessage(SendMessage SendMessageObject = null) { JavaScriptSerializer jsonSerializer = new JavaScriptSerializer(); string message = jsonSerializer.Serialize(SendMessageObject); var webAddr = “https://api.telegram.org/bot”+Token; var httpWebRequest = (HttpWebRequest)WebRequest.Create(webAddr); httpWebRequest.ContentType = “application/json; charset=utf-8”; httpWebRequest.Method = “POST”; using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream())) { string json = message; streamWriter.Write(json); streamWriter.Flush(); } }

public class sendMessage { public string method { get { return “sendMessage”; }} public int chat_id { get; set; } public string text { get; set; } public string parse_mode { get; set; } public bool disable_web_page_preview { get; set; } public bool disable_notification { get; set; } public int reply_to_message_id { get; set; } public ReplyKeyboardMarkup reply_markup { get; set; } }

Why call it a “major” revision if the suggested changes are seemingly minor?

asp.net