/
replyAttachment.go
56 lines (45 loc) · 1.26 KB
/
replyAttachment.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package dolores_slack
import (
"encoding/json"
"github.com/nlopes/slack"
)
var (
SlackAttachmentDefaultColor = "#36a64f"
)
func SampleAttachment() slack.Attachment {
attachment := slack.Attachment{
Color: SlackAttachmentDefaultColor,
Fallback: "Required plain-text summary of the attachment.",
AuthorName: "Bobby Tables",
AuthorSubname: "BobT",
AuthorLink: "http://flickr.com/bobby/",
AuthorIcon: "http://flickr.com/icons/bobby.jpg",
Title: "Slack API Documentation",
TitleLink: "https://api.slack.com/",
Text: "Optional text that appears within the attachment",
Pretext: "Optional text that appears above the attachment block",
ImageURL: "http://my-website.com/path/to/image.jpg",
ThumbURL: "http://example.com/path/to/thumb.png",
Fields: []slack.AttachmentField{
slack.AttachmentField{
Title: "Priority",
Value: "High",
Short: false,
},
},
Actions: []slack.AttachmentAction{
slack.AttachmentAction{
Name: "Oye",
Text: "oye oye",
Style: "b",
Type: "button",
Value: "oye",
},
},
MarkdownIn: []string{},
Footer: "Slack API",
FooterIcon: "https://platform.slack-edge.com/img/default_application_icon.png",
Ts: json.Number("123456789"),
}
return attachment
}