EasyDiscordWebhooks 1.0.0

dotnet add package EasyDiscordWebhooks --version 1.0.0
NuGet\Install-Package EasyDiscordWebhooks -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EasyDiscordWebhooks" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EasyDiscordWebhooks --version 1.0.0
#r "nuget: EasyDiscordWebhooks, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install EasyDiscordWebhooks as a Cake Addin
#addin nuget:?package=EasyDiscordWebhooks&version=1.0.0

// Install EasyDiscordWebhooks as a Cake Tool
#tool nuget:?package=EasyDiscordWebhooks&version=1.0.0

ReadMe for EasyDiscordWebhooks

Introduction and Setup:

This is an over simplified way of sending messages or embeds through Discord Webhooks. This program can be utilized in Console Applications, Windows Form Applications, Asp.NET, and more; however, in this ReadMe, we will use a Console Application.

Initialization:

Inside of your Program.cs file, you will want to create a basic asynchronous method, as the Webhooks are asynchronous. You can do so with the following code, manipulating your entry Main method.

public static void Main(string[] args) => new Program().Start().GetAwaiter().GetResult();

private async Task Start() {

}

When you have this ready, you will need to create the Webhook itself. You will need your Webhook URL to initialize your Webhook. Enter this inside of the Start method.

Webhook Hook = WebhookBuilder.Builder("<Your_URL>");

In order for these to work, you'll need to use these two namespaces.

using Webhooks.Handler;
using Webhooks.Discord; // OPTIONAL - Remove if not using Embeds.

Congratulations, your Webhook is now set up!

Sending Discord Messages

Now that your Webhook is set up, let's use it to send some simple, basic Discord messages.

Use the code below to send Discord messages:

await Hook.SendMessage("<Your_Message>");

Sending Discord Embeds

Preparing the Embed

Using Embeds it a little bit trickier, but is still fairly simple. It is also similar to how you'd do an Embed on a Discord.NET bot. First, you'll need to build the Embed with an EmbedBuilder.

Embed Embed = new EmbedBuilder().Build();

Now, the above code is rather useless, since your embeds will fail to send due to a lack of content. To start setting content, you'll need to do the following.

Embed Embed = new EmbedBuilder {
    Content = "Your_Content"
}.Build();

The above code is the bare minimum to send an Embed. All other fields are optional. Below is what a full Embed would look like.

Embed Embed = new EmbedBuilder { 
    Title = "Your_Title",
    Content = "Your_Content",
    Color = 0x11AAFF,
    Image = "Your_Image_URL",
    Thumbnail = "Your_Thumbnail_URL",
    Url = "Your_URL",
    Author = new EmbedAuthor("Your_Name", "Your_Author_Url", "Your_Icon_Url"),
    Footer = new EmbedFooter("Your_Footer_Text", "Your_Icon_Url"),
    Fields = new EmbedField[1]
    {
        new EmbedField("Your_Field_Name", "Your_Field_Value")
    }
}.Build();

The above is a completed Embed, but keep in mind that only the Content field is required.

The Color field is a hexidecimal color code for Embed. You will only need 3 values (RGB) rather than 4 (RGBA). If you are new to hexidecimal colors, you can use a program to convert your colors for you. One such programs would be on this website: https://www.color-hex.com/

Finally, now that your have your Embed built and ready for use, you will want to send it through the Webhook that you have.

await Hook.SendEmbed(Embed);

Thank You

Thank you for using EasyDiscordWebhooks!

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 349 11/2/2021