Notify when live
This commit is contained in:
21
NostrStreamer/Services/DiscordWebhook.cs
Normal file
21
NostrStreamer/Services/DiscordWebhook.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System.Net.Http.Formatting;
|
||||
|
||||
namespace NostrStreamer.Services;
|
||||
|
||||
public class DiscordWebhook
|
||||
{
|
||||
private readonly HttpClient _client;
|
||||
|
||||
public DiscordWebhook(HttpClient client)
|
||||
{
|
||||
_client = client;
|
||||
}
|
||||
|
||||
public async Task SendMessage(Uri webhook, string msg)
|
||||
{
|
||||
await _client.PostAsync(webhook, new
|
||||
{
|
||||
content = msg
|
||||
}, new JsonMediaTypeFormatter());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user