Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ttakahari/slacksharp
Slack API clinet library for C#.
https://github.com/ttakahari/slacksharp
csharp slack
Last synced: 26 days ago
JSON representation
Slack API clinet library for C#.
- Host: GitHub
- URL: https://github.com/ttakahari/slacksharp
- Owner: ttakahari
- License: mit
- Created: 2018-04-28T07:50:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-10T14:59:56.000Z (almost 6 years ago)
- Last Synced: 2024-12-09T22:36:44.708Z (about 1 month ago)
- Topics: csharp, slack
- Language: C#
- Homepage:
- Size: 25.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SlackSharp
Slack API clinet library for C#.
Currently support for only Incoming WebHooks API.
[![AppVeyor](https://img.shields.io/appveyor/ci/gruntjs/grunt.svg?style=plastic)](https://ci.appveyor.com/project/ttakahari/SlackSharp)
[![NuGet](https://img.shields.io/nuget/v/SlackSharp.svg?style=plastic)](https://www.nuget.org/packages/SlackSharp/)## Install
from NuGet - [SlackSharp](https://www.nuget.org/packages/SlackSharp/)
```ps1
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.
```csharp
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](https://github.com/JamesNK/Newtonsoft.Json)(Standard JSON Library of .NET), [Jil](https://github.com/kevin-montrose/Jil)(Fastest Text-Format JSON Library) or [Utf8Json](https://github.com/neuecc/Utf8Json)(Fastest Binary-Format JSON Library).
## Lisence
under [MIT Lisence](https://opensource.org/licenses/MIT).