20 lines
644 B
C#
20 lines
644 B
C#
|
using System;
|
||
|
using System.IO;
|
||
|
using System.Net;
|
||
|
|
||
|
public class Log
|
||
|
{
|
||
|
public static string call_for_humans_discord_webhook{get;set;}
|
||
|
public static void Panic(string message)
|
||
|
{
|
||
|
Console.Error.WriteLine(message);
|
||
|
var httpWebRequest = (HttpWebRequest)WebRequest.Create(call_for_humans_discord_webhook);
|
||
|
httpWebRequest.ContentType = "application/json";
|
||
|
httpWebRequest.Method = "POST";
|
||
|
using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
|
||
|
{
|
||
|
streamWriter.Write("{\"content\":\"" + message + "\"}");
|
||
|
}
|
||
|
httpWebRequest.GetResponse();
|
||
|
}
|
||
|
}
|