added support for discord.

This commit is contained in:
DESKTOP-T0O5CDB\DESK-555BD
2024-12-06 08:42:25 -07:00
parent c791070126
commit 8fd49e20d5
2 changed files with 26 additions and 2 deletions

View File

@@ -327,7 +327,15 @@ namespace CarCareTracker.Helper
return;
}
var httpClient = new HttpClient();
httpClient.PostAsJsonAsync(webhookURL, webHookPayload);
if (webhookURL.StartsWith("discord://"))
{
webhookURL = webhookURL.Replace("discord://", "https://"); //cleanurl
//format to discord
httpClient.PostAsJsonAsync(webhookURL, DiscordWebHook.FromWebHookPayload(webHookPayload));
} else
{
httpClient.PostAsJsonAsync(webhookURL, webHookPayload);
}
}
public static string GetImportModeIcon(ImportMode importMode)
{