From fd3e5f61cbbc315a07b9faa36f739b8fe7af3071 Mon Sep 17 00:00:00 2001 From: Florian Stinglmayr Date: Tue, 17 Sep 2024 18:57:38 +0200 Subject: [PATCH] allow override of username in posting --- EliteBGS/DiscordPoster.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EliteBGS/DiscordPoster.cs b/EliteBGS/DiscordPoster.cs index 6cc59af..2c69989 100644 --- a/EliteBGS/DiscordPoster.cs +++ b/EliteBGS/DiscordPoster.cs @@ -9,10 +9,10 @@ namespace EliteBGS; public class DiscordPoster { 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(); obj.Add("content", log); - obj.Add("username", "EDBGS"); + obj.Add("username", username); using (var client = new HttpClient()) { var content = new StringContent(obj.ToString(), Encoding.UTF8, "application/json");