LogoLogo
HomePricingDocumentation
  • 💿Getting Started
    • Installation and Project Setup
    • Hello Perigee!
    • Perigee Application Design
    • Hello Configuration
    • Hello Logs
    • Hello Integration
    • Troubleshooting
    • Case Studies
  • 📃License + Notice
    • 📂Licensing
    • Notice of Third Party Agreements
  • 🚀Perigee and Beyond
    • Extending - Threads
    • Extending - Loaders
    • ⏳All about CRON
  • 🔮API Generation
    • What is API Generation?
    • API Builder
  • 🗺️Architecting YOUR App
    • Design and Requirements
    • Define Sources
    • Requirements
  • 🧩Core Modules
    • 🌐PerigeeApplication
    • 🪡Thread Registry
    • Event Sources
      • Scheduled/Logic
        • CRON Thread
        • Scheduler
        • Sync Agent
      • Watchers
        • SalesForce
        • Sharepoint
        • Directory Watch
        • Directory Notifier
        • IMAP
    • Credential Management
      • Connection Strings
      • Custom Refresh Logic
      • RestSharp Authenticator
      • Credential Store SDK
      • ⁉️Troubleshooting Credentials
    • Integration Utilities
      • HTTP(S) - RestSharp
      • Transaction Coordinator
      • Limiter
      • Watermarking
    • Alert Managers
      • SMS
      • Email
      • Discord
      • Teams
    • File Formats
      • Excel
      • CSV
    • 📁File System Storage
      • File Revision Store
      • Concurrent File Store
      • FileSync + Cache
    • Third Party
      • SmartSheets
      • Microsoft Graph
    • Perigee In Parallel
      • Parallel Processing Reference
      • Extensions
      • GroupProcessor
      • SingleProcessor
    • 🧱Utility Classes
      • Metrics
      • F(x) Expressions
      • Multi-Threaded Processor (Scatter Gather)
      • OpenAI - GPT
      • XML Converter
      • Dynamic Data Table
      • Debounce
      • Thread Conditions
      • Perigee Utility Class
      • Network Utility
      • Lists
      • FileUtil
      • Inclusive2DRange
      • Strings, Numbers, Dates
      • Nested Sets
      • Behavior Trees
      • JsonCompress
      • Topological Sorting
      • DBDownloader
    • 🈁Bit Serializer
  • 📣Examples and Demos
    • API + Perigee
    • 📰Excel Quick Load
    • SalesForce Watcher
    • Report Scheduler
    • Agent Data Synchronization
    • 📩IMAP Echo bot
    • Watch and load CSVs
    • Graph Delegated Authorization + DataVerse
    • Coordinator Demo
    • Azure Service Bus
    • QuickBooks Online
  • 📘Blueprints
    • Perigee With .NET Hosting
    • Web Host Utilities
    • 🔌Plugin Load Context
  • 🎞️Transforms
    • 🌟What is Transforms?
    • 📘Terminology
    • 🦾The Mapping Document
    • 👾Transformation Process
    • 😎Profile
    • 🎒Automation
      • 🕓Package Options
      • 🔳Configuration
    • 🔧Utilities
      • 🧹Clean
      • 📑Map File
      • 🔎File Identification
      • 🗺️Map Generation
      • 🪅Insert Statement Generation
  • 🗃️Transform SDK
    • 👋Quick Start Guide
    • 🥳MapTo
    • 🔌Authoring Plugins
      • 🔘File IO Process
      • 📢Data Quality
      • 🟢Transform Process
    • SDK Reference
      • 🔘FileIOProcessData
      • 📢DataQualityContext
      • 🎛️TransformDataContext
      • 🏅TransformResult
Powered by GitBook
On this page
Export as PDF
  1. Core Modules
  2. Alert Managers

Discord

To use the embedded discord client. Register the hook URI at start, then call anywhere else

Code

PerigeeApplication.ApplicationNoInit("Discord",  (c) => {

    //Register once
    AlertManager.RegisterDiscordWebhook("bot", "WEBHOOKURI");

    //Call anywhere else
    int IssueCount = 0;
    AlertManager.Webhook_Discord("bot", new DiscordMessage()
    {
        Embeds = new List<DiscordEmbed>() {
            new DiscordEmbed() {
                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 = new List<EmbedField> {

                    new EmbedField() { InLine = true, Name = "Server", Value = "MyServer"},
                    new EmbedField() { InLine = true, Name = "Issue Count", Value =  IssueCount.ToString() },
                    new EmbedField() { 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:

AlertManager.Webhook_Discord("bot", DiscordMessage.Builder(
        $"My awesome discord enabled app {(IssueCount > 0 ? "failed" : "completed")}",
        IssueCount > 0 ? "Issues exist, please check log." : "Everything completed as expected", null,
        IssueCount > 0 ? System.Drawing.Color.Yellow : System.Drawing.Color.Green,
        EmbedField.Builder("Server", "MyServer"),
        EmbedField.Builder("Issue Count", IssueCount.ToString()),
        EmbedField.Builder("Location", Directory.GetCurrentDirectory())));
PreviousEmailNextTeams

Last updated 2 years ago

🧩
Page cover image