fix interface

This commit is contained in:
Tommy Parnell
2019-07-20 11:06:40 -04:00
parent 1325d14ce7
commit ffdd33f10c

View File

@@ -16,7 +16,7 @@ namespace bundlephobia
{
class SlackPost
{
public Dictionary<string, string> attachments { get; set; }
public IEnumerable<object> attachments { get; set; }
[JsonProperty("unfurl_links")]
public bool unfurlLinks { get; set; } = true;
[JsonProperty("unfurl_media")]
@@ -50,9 +50,9 @@ namespace bundlephobia
var version = respData.Keys.OrderByDescending(a => a).First();
var payload = new SlackPost()
{
attachments = new Dictionary<string, string>()
attachments = new List<object>()
{
["text"] = $"https://bundlephobia.com/result?p={text}@{version}"
new { text = $"https://bundlephobia.com/result?p={text}@{version}" },
}
};
await Client.PostAsJsonAsync(responseUrl, payload);