Created
July 15, 2021 11:34
-
-
Save apolzek/d24b88ad390e79b3ed8efa626a1d0b75 to your computer and use it in GitHub Desktop.
Send Message Webhook Discord | .NET Core
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using RestSharp; | |
using RestClient; | |
using System.Collections.Generic; | |
using System.Data; | |
using RestSharp.Extensions; | |
using System.Linq; | |
using System.Threading; | |
namespace console | |
{ | |
class Program | |
{ | |
static void send_message_webhook_discord() | |
{ | |
var client = new RestSharp.RestClient("https://discordapp.com/api/webhooks/<SEUTOKEN>"); | |
client.Timeout = -1; | |
var request = new RestRequest(Method.POST); | |
request.AddHeader("Content-Type", "application/json"); | |
request.AddHeader("Cookie", "__cfduid=d70a9d4e066082c1389c6068d74e21a131603737701"); | |
request.AddParameter("application/json", "{\"username\": \"apolzek\", \"content\": \"L4B N4 M4DRUG4D4!\"}", ParameterType.RequestBody); | |
IRestResponse response = client.Execute(request); | |
Console.WriteLine(response.Content); | |
} | |
static void Main(string[] args) | |
{ | |
while (true) | |
{ | |
Console.WriteLine("Send message ;)"); | |
send_message_webhook_discord(); | |
Thread.Sleep(2000); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment