Skip to content

Commit

Permalink
preparion for v5
Browse files Browse the repository at this point in the history
  • Loading branch information
ayan kashif committed Jun 5, 2023
1 parent bfb3efa commit 99ffdb2
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions webhooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,40 @@ public void fancyHelloWorld(string webhookUrl)
}
var response = (HttpWebResponse)wr.GetResponse();
}
public void informationEmbed(string webhookUrl, string information)
{
WebRequest wr = (HttpWebRequest)WebRequest.Create(webhookUrl);
wr.ContentType = "application/json";
wr.Method = "POST";

using (var sw = new StreamWriter(wr.GetRequestStream()))
{
string json = JsonConvert.SerializeObject(new
{
username = "New Information!",
embeds = new[]
{
new
{
description = information,
title = "New Information!",
color = "008000",

footer = new {
icon_url = "https://www.pngmart.com/files/22/Notification-Bell-PNG.png",
text = "Thats all!" + " | Made with CSCord"
}
}
}
});

sw.Write(json);
}
var response = (HttpWebResponse)wr.GetResponse();
}

}

}

//thats it.

0 comments on commit 99ffdb2

Please sign in to comment.