To use the embedded discord client. Register the hook URI at start, then call anywhere else
Code
PerigeeApplication.ApplicationNoInit("Discord", (c) => { //Register onceAlertManager.RegisterDiscordWebhook("bot","WEBHOOKURI"); //Call anywhere elseint IssueCount =0;AlertManager.Webhook_Discord("bot",newDiscordMessage() { Embeds =newList<DiscordEmbed>() {newDiscordEmbed() { Title =$"My awesome discord enabled app {(IssueCount >0? "failed" : "completed")}", Description = IssueCount >0?"Issues exist, please check log.":"Everything completed as expected", Color = IssueCount >0?System.Drawing.Color.Yellow:System.Drawing.Color.Green, Fields =newList<EmbedField> {newEmbedField() { InLine =true, Name ="Server", Value ="MyServer"},newEmbedField() { InLine =true, Name ="Issue Count", Value =IssueCount.ToString() },newEmbedField() { InLine =false, Name ="Location", Value =Directory.GetCurrentDirectory() }, } } } });});
There's also a builder method is you're creating the same information, it makes the creation a bit more compact and without having to remember the nested syntax: