From 145ed7699f55d846f490a8c1981b6e466caf2eaf Mon Sep 17 00:00:00 2001 From: Daniel Muckerman Date: Sun, 17 Jan 2016 23:11:24 -0500 Subject: [PATCH] Made attachments work --- slack-pixiv/commands/pixiv.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/slack-pixiv/commands/pixiv.rb b/slack-pixiv/commands/pixiv.rb index e2a9f46..2e90fab 100644 --- a/slack-pixiv/commands/pixiv.rb +++ b/slack-pixiv/commands/pixiv.rb @@ -7,7 +7,19 @@ module SlackMathbot #asdf puts _match[:url] #client.say(channel: _data.channel, text: "Testing: http://pixiv.net#{_match[:url]}") - client.say(channel: _data.channel, attachments: "[{'pretext': 'pre-hello', 'text': 'text-world'}]") + client.web_client.chat_postMessage( + channel: _data.channel, + as_user: true, + attachments: [ + { + fallback: "Ticket #1943: Can't rest my password - https://groove.hq/path/to/ticket/1943", + title: "Ticket #1943: Can't reset my password", + title_link: "http://www.pixiv.net" + _match[:url][1..-1], + text: "Help! I tried to reset my password but nothing happened!", + color: "#7CD197" + } + ].to_json + ) #send_message client, _data.channel, "Testing: #{_match[:url]}" end