-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtemplates.go
29 lines (27 loc) · 1.04 KB
/
templates.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
package main
import "html/template"
var powerT = template.Must(template.New("power").Parse(`{
"text": "{{.title}}",
"attachments": [
{ "text": "{{.status}}" },
{
"fallback": "Your slack client does not support interactivity :(",
"callback_id": "{{.callback}}",
"color": "#0f0",
"actions": [
{ "name": "power", "text": "Status", "type": "button", "value": "status" },
{ "name": "power", "text": "On", "type": "button", "value": "on", "style": "primary" }
]
},
{
"fallback": "Your slack client does not support interactivity :(",
"callback_id": "{{.callback}}",
"color": "#f00",
"actions": [
{ "name": "power", "text": "Off", "type": "button", "value": "off", "style": "danger" },
{ "name": "power", "text": "Reset", "type": "button", "value": "reset", "style": "danger" },
{ "name": "power", "text": "Cycle", "type": "button", "value": "cycle", "style": "danger" }
]
}
]
}`))