ok I figured slack out

This commit is contained in:
Tommy Parnell
2019-07-20 11:22:44 -04:00
parent 5b850c0e1a
commit 50e85b8bd2

12
Main.cs
View File

@@ -16,7 +16,10 @@ namespace bundlephobia
{ {
class SlackPost class SlackPost
{ {
public IEnumerable<object> attachments { get; set; } public string text { get; set; }
public bool unfurl_links { get; set; } = true;
public bool unfurl_media { get; set; } = true;
public string response_type { get; set; } = "in_channel";
} }
public static class Main public static class Main
@@ -46,14 +49,7 @@ namespace bundlephobia
var version = respData.Keys.OrderByDescending(a => a).First(); var version = respData.Keys.OrderByDescending(a => a).First();
var payload = new SlackPost() var payload = new SlackPost()
{ {
attachments = new List<object>()
{
new {
text = $"https://bundlephobia.com/result?p={text}@{version}", text = $"https://bundlephobia.com/result?p={text}@{version}",
unfurl_links = true,
unfurl_media = true
},
}
}; };
await Client.PostAsJsonAsync(responseUrl, payload); await Client.PostAsJsonAsync(responseUrl, payload);
} }