{"id":20545850,"url":"https://github.com/xin9le/slack.integration","last_synced_at":"2025-04-14T10:12:12.558Z","repository":{"id":33558707,"uuid":"159305473","full_name":"xin9le/Slack.Integration","owner":"xin9le","description":"Slack API for .NET","archived":false,"fork":false,"pushed_at":"2024-11-18T09:12:37.000Z","size":82,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T06:35:44.740Z","etag":null,"topics":["slack","webhook"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xin9le.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-27T08:58:00.000Z","updated_at":"2024-11-18T09:10:46.000Z","dependencies_parsed_at":"2022-08-07T22:15:13.594Z","dependency_job_id":null,"html_url":"https://github.com/xin9le/Slack.Integration","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xin9le%2FSlack.Integration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xin9le%2FSlack.Integration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xin9le%2FSlack.Integration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xin9le%2FSlack.Integration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xin9le","download_url":"https://codeload.github.com/xin9le/Slack.Integration/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248860190,"owners_count":21173342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["slack","webhook"],"created_at":"2024-11-16T01:53:33.134Z","updated_at":"2025-04-14T10:12:12.547Z","avatar_url":"https://github.com/xin9le.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Slack.Integration\n\nThis library provides Slack APIs. You can integrate your service and Slack. Currently support is only Incoming Webhook.\n\n- Incoming Webhook\n- Slash Command\n- Easy to pass known colors and emojis\n\n[![Releases](https://img.shields.io/github/release/xin9le/Slack.Integration.svg)](https://github.com/xin9le/Slack.Integration/releases)\n[![GitHub license](https://img.shields.io/github/license/xin9le/Slack.Integration)](https://github.com/xin9le/Slack.Integration/blob/master/LICENSE)\n\n\n## Support Platform\n\n- .NET Framework 4.6.2+\n- .NET Standard 2.0+\n- .NET 8.0+\n\n\n\n## Incoming Webhook\n\nSuper easy to use.\n\n```cs\nvar url = \"\u003cYour Incoming Webhook URL here.\u003e\";\nvar payload = new Payload { Text = \"Hello, Slack!!\" };\nvar client = new WebhookClient();\nawait client.SendAsync(url, payload);\n```\n\nFollowing is payload sample.\n\n```cs\nvar payload = new Payload\n{\n    UserName = \"Incoming Webhook\",\n    Text = \"Hello, @xin9le !!\\n\\nThis posts is test for _Incoming WebHook_ .\\nDocument is \u003chttps://api.slack.com/incoming-webhooks|here\u003e.\",\n    Markdown = true,\n    Channel = \"#random\",  // override channel\n    LinkNames = true,\n    IconEmoji = KnownEmoji.PlusOne,\n    Attachments = new []\n    {\n        new Attachment\n        {\n            Fallback = \"脱・読みづらいコード！今日から一段上のプログラマーになる方法 5 選\",\n            Color = Color.AliceBlue.ToHex(),\n            PreText = \"This text is optional that is displayed at the top of _attachment block_ .\",\n            AuthorName = \"xin9le\",\n            AuthorLink = \"http://xin9le.net\",\n            AuthorIcon = \"https://pbs.twimg.com/profile_images/1047114972118114305/vw07RO7H_normal.jpg\",\n            Title = \"脱・読みづらいコード！今日から一段上のプログラマーになる方法 5 選\",\n            TitleLink = \"http://blog.xin9le.net/entry/2016/02/26/043557\",\n            Text = \"「ソースコードを綺麗に書く」というのは、プログラマーであれば誰しもが心掛けたいと思っている *極めて重要な事柄* です。そもそも「綺麗なコードってなんぞ？」という感じですが、いくつかあると思います。\",\n            ImageUrl = \"http://cdn-ak.f.st-hatena.com/images/fotolife/x/xin9le/20160226/20160226040749.png\",\n            ThumbUrl = \"https://pbs.twimg.com/profile_images/1047114972118114305/vw07RO7H_normal.jpg\",\n            Footer = \"xin9le\",\n            FooterIcon = \"https://pbs.twimg.com/profile_images/1047114972118114305/vw07RO7H_normal.jpg\",\n            Timestamp = DateTimeOffset.Now.ToUnixTimeSeconds(),\n            Fields = new []\n            {\n                new Field\n                {\n                    Title = \"Unique User\",\n                    Value = \"345\",\n                    Short = true,\n                },\n                new Field\n                {\n                    Title = \"Page View\",\n                    Value = \"12345\",\n                    Short = true,\n                },\n            },\n            Actions = new []\n            {\n                new Slack.Integration.IncomingWebhook.Action\n                {\n                    Type = ActionType.Button,\n                    Text = \"GitHub\",\n                    Url = \"https://github.com/xin9le\",\n                    Style = ActionStyle.Default,\n                },\n                new Slack.Integration.IncomingWebhook.Action\n                {\n                    Type = ActionType.Button,\n                    Text = \"Blog\",\n                    Url = \"https://blog.xin9le.net\",\n                    Style = ActionStyle.Primary,\n                },\n                new Slack.Integration.IncomingWebhook.Action\n                {\n                    Type = ActionType.Button,\n                    Text = \"Twitter\",\n                    Url = \"https://twitter.com/xin9le\",\n                    Style = ActionStyle.Danger,\n                },\n            },\n        },\n    },\n};\n```\n\n![2018-11-29 15 49 39](https://user-images.githubusercontent.com/4776688/49205381-344e9300-f3f2-11e8-8849-cd446dd2a6d4.png)\n\n\n\n## Slash Command\n\nSlash Command requests sent from Slack can be mapped as follows.\n\n```cs\nusing Microsoft.AspNetCore.Mvc;\nusing Slack.Integration.SlashCommand;\n\npublic class SlashCommandController : Controller\n{\n    [HttpPost]\n    public IAsyncResult DoSomething([FromForm]Request request)  // request mapping\n    {\n        // do something\n        return this.Ok();\n    }\n}\n```\n\n\n\n## Installation\n\nGetting started from downloading [NuGet](https://www.nuget.org/packages/Slack.Integration) package.\n\n```\ndotnet add package Slack.Integration\n```\n\n\n\n## License\n\nThis library is provided under [MIT License](http://opensource.org/licenses/MIT).\n\n\n\n## Author\n\nTakaaki Suzuki (a.k.a [@xin9le](https://twitter.com/xin9le)) is software developer in Japan who awarded Microsoft MVP for Developer Technologies (C#) since July 2012.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxin9le%2Fslack.integration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxin9le%2Fslack.integration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxin9le%2Fslack.integration/lists"}