allow override of username in posting
This commit is contained in:
parent
e617c3852b
commit
fd3e5f61cb
@ -9,10 +9,10 @@ namespace EliteBGS;
|
|||||||
public class DiscordPoster {
|
public class DiscordPoster {
|
||||||
public static readonly int DiscordLimit = 2000;
|
public static readonly int DiscordLimit = 2000;
|
||||||
|
|
||||||
public static void PostToDiscord(DiscordWebhook webhook, string log) {
|
public static void PostToDiscord(DiscordWebhook webhook, string log, string username = "EDBGS") {
|
||||||
JsonObject obj = new();
|
JsonObject obj = new();
|
||||||
obj.Add("content", log);
|
obj.Add("content", log);
|
||||||
obj.Add("username", "EDBGS");
|
obj.Add("username", username);
|
||||||
|
|
||||||
using (var client = new HttpClient()) {
|
using (var client = new HttpClient()) {
|
||||||
var content = new StringContent(obj.ToString(), Encoding.UTF8, "application/json");
|
var content = new StringContent(obj.ToString(), Encoding.UTF8, "application/json");
|
||||||
|
Loading…
Reference in New Issue
Block a user