Skip to content

ttakahari/SlackSharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SlackSharp

Slack API clinet library for C#.

Currently support for only Incoming WebHooks API.

AppVeyor NuGet

Install

from NuGet - SlackSharp

PM > Install-Package SlackSharp

How to use

Create an instance of WebHookClient with a serializer instance implementing IHttpContentJsonSerializer.

Call SendAsync method with arguments that are Incoming-WebHooks URL and a message.

using (var client = new WebHookClient(new JsonNetSerializer()))
{
    // Simple message
    {
        var response = await client.SendAsync("[Your Incoming WebHooks URL]", "Hello Slack");
    }

    // Strcutured message
    {
        var payload = new Payload
        {
            Channel = "random",
            Username = "an user",
            Text = "Hello Slack"
        };

        var response = await client.SendAsync("[Your Incoming WebHooks URL]", payload);
    }
}

Serialization

Provides serializers implementing Json.NET(Standard JSON Library of .NET), Jil(Fastest Text-Format JSON Library) or Utf8Json(Fastest Binary-Format JSON Library).

Lisence

under MIT Lisence.

About

Slack API clinet library for C#.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages