WebhookSenderHub 1.0.1
See the version list below for details.
dotnet add package WebhookSenderHub --version 1.0.1
NuGet\Install-Package WebhookSenderHub -Version 1.0.1
<PackageReference Include="WebhookSenderHub" Version="1.0.1" />
paket add WebhookSenderHub --version 1.0.1
#r "nuget: WebhookSenderHub, 1.0.1"
// Install WebhookSenderHub as a Cake Addin #addin nuget:?package=WebhookSenderHub&version=1.0.1 // Install WebhookSenderHub as a Cake Tool #tool nuget:?package=WebhookSenderHub&version=1.0.1
WebhookSenderHub
WebhookSenderHub is a .NET library that allows you to send webhook messages to various real-time messaging platforms such as Teams, Slack, and Discord using webhooks.
Compatibility
This library is compatible with .NET Standard 2.0.
Installation
You can install the WebhookSenderHub NuGet package using the following command in the NuGet Package Manager Console:
Install-Package WebhookSenderHub
Usage
Microsoft Teams
To send messages to Microsoft Teams using the TeamsService
, follow these steps:
- Install the
WebhookSenderHub
NuGet package. - Create an instance of the
TeamsService
class with the webhook URL and optional channel name. - Use the various
SendAsync
methods to send messages to Teams.
Here's an example of sending a message to Teams:
using WebhookSenderHub;
IMessagingService messagingService = new TeamsService("your_teams_webhook_url", "optional_channel_name");
bool success = await messagingService.SendAsync("Hello from WebhookSenderHub!", "Webhook Message", "This is a sample message.", "#0078D4");
if (success)
{
Console.WriteLine("Message sent successfully to Teams!");
}
else
{
Console.WriteLine("Message sending failed to Teams.");
}
Replace "your_teams_webhook_url"
with your actual Teams webhook URL and "optional_channel_name"
with the desired channel name, if applicable.
Remember to customize the message content, title, summary, and theme color as needed for your use case.
For more information on Teams message formatting, refer to the Microsoft Teams documentation.
Slack
To send messages to Slack using the SlackService
, follow these steps:
- Install the
WebhookSenderHub
NuGet package. - Create an instance of the
SlackService
class with the webhook URL and optional channel name. - Use the various
SendAsync
methods to send messages to Teams.
Here's an example of sending a message to Teams:
using WebhookSenderHub;
IMessagingService messagingService = new SlackService("your_slack_webhook_url", "optional_channel_name");
bool success = await messagingService.SendAsync("Hello from WebhookSenderHub!", "Webhook Message", "This is a sample message.");
if (success)
{
Console.WriteLine("Message sent successfully to Slack!");
}
else
{
Console.WriteLine("Message sending failed to Slack.");
}
Discord
To send messages to Discord using the DiscordService
, follow these steps:
- Install the
WebhookSenderHub
NuGet package. - Create an instance of the
DiscordService
class with the webhook URL and optional channel name. - Use the various
SendAsync
methods to send messages to Teams.
Here's an example of sending a message to Teams:
using WebhookSenderHub;
IMessagingService messagingService = new DiscordService("your_discord_webhook_url");
bool success = await messagingService.SendAsync("Hello from WebhookSenderHub!", "Webhook Message", "This is a sample message.", "#FF5733");
if (success)
{
Console.WriteLine("Message sent successfully to Discord!");
}
else
{
Console.WriteLine("Message sending failed to Discord.");
}
Contributing
Contributions are welcome! Feel free to submit issues, pull requests, or feedback in the GitHub repository.
Product | Versions 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. |
-
.NETStandard 2.0
- System.Text.Json (>= 7.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.