public static User GetMe(string apikey) { #if DEBUG Console.WriteLine("\nGetting me [" + DateTime.Now + "]...\n"); #endif string json; { HttpWebRequest client = (HttpWebRequest)WebRequest.Create("https://api.telegram.org/bot" + apikey + "/getMe"); try { Stream data = client.GetResponse().GetResponseStream(); using (StreamReader reader = new StreamReader(data)) { json = reader.ReadToEnd(); } } catch (WebException e) { Notifications.log(e.ToString()); return(null); } } #if DEBUG Console.WriteLine(JsonEnhancer.FormatJson(json)); #endif GetMeResponse response = JsonConvert.DeserializeObject <GetMeResponse>(json); return(response.Result); }
public GetMeResponse GetMe(GetMeRequest getMeRequest) { Log.Info(nameof(GetMe)); return(GetMeResponse.Parse(ExecuteAction(getMeRequest))); }
public GetMeResponse GetMe(GetMeRequest getMeRequest) { return(GetMeResponse.Parse(ExecuteAction(getMeRequest))); }