This repository has been archived by the owner on Dec 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
data.go
178 lines (158 loc) · 4.54 KB
/
data.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
package slacktest
import (
"fmt"
slack "github.com/nlopes/slack"
)
const defaultBotName = "TestSlackBot"
const defaultBotID = "U023BECGF"
const defaultTeamID = "T024BE7LD"
const defaultNonBotUserID = "W012A3CDE"
const defaultNonBotUserName = "Egon Spengler"
const defaultTeamName = "SlackTest Team"
const defaultTeamDomain = "testdomain"
var defaultCreatedTs = nowAsJSONTime()
var defaultTeam = &slack.Team{
ID: defaultTeamID,
Name: defaultTeamName,
Domain: defaultTeamDomain,
}
var defaultBotInfo = &slack.UserDetails{
ID: defaultBotID,
Name: defaultBotName,
Created: defaultCreatedTs,
ManualPresence: "true",
Prefs: slack.UserPrefs{},
}
var okWebResponse = slack.WebResponse{
Ok: true,
}
var defaultChannelsListJSON = fmt.Sprintf(`
{
"ok": true,
"channels": [%s, %s]
}
`, defaultGeneralChannelJSON, defaultExtraChannelJSON)
var defaultGroupsListJSON = fmt.Sprintf(`
{
"ok": true,
"groups": [%s]
}
`, defaultGroupJSON)
var defaultUsersInfoJSON = fmt.Sprintf(`
{
"ok":true,
%s
}
`, defaultNonBotUser)
var defaultGeneralChannelJSON = fmt.Sprintf(`
{
"id": "C024BE91L",
"name": "general",
"is_channel": true,
"created": %d,
"creator": "%s",
"is_archived": false,
"is_general": true,
"members": [
"W012A3CDE"
],
"topic": {
"value": "Fun times",
"creator": "%s",
"last_set": %d
},
"purpose": {
"value": "This channel is for fun",
"creator": "%s",
"last_set": %d
},
"is_member": true
}
`, nowAsJSONTime(), defaultNonBotUserID, defaultNonBotUserID, nowAsJSONTime(), defaultNonBotUserID, nowAsJSONTime())
var defaultExtraChannelJSON = fmt.Sprintf(`
{
"id": "C024BE92L",
"name": "bot-playground",
"is_channel": true,
"created": %d,
"creator": "%s",
"is_archived": false,
"is_general": true,
"members": [
"W012A3CDE"
],
"topic": {
"value": "Fun times",
"creator": "%s",
"last_set": %d
},
"purpose": {
"value": "This channel is for fun",
"creator": "%s",
"last_set": %d
},
"is_member": true
}
`, nowAsJSONTime(), defaultNonBotUserID, defaultNonBotUserID, nowAsJSONTime(), defaultNonBotUserID, nowAsJSONTime())
var defaultGroupJSON = fmt.Sprintf(`{
"id": "G024BE91L",
"name": "secretplans",
"is_group": true,
"created": %d,
"creator": "%s",
"is_archived": false,
"members": [
"W012A3CDE"
],
"topic": {
"value": "Secret plans on hold",
"creator": "%s",
"last_set": %d
},
"purpose": {
"value": "Discuss secret plans that no-one else should know",
"creator": "%s",
"last_set": %d
}
}`, nowAsJSONTime(), defaultNonBotUserID, defaultNonBotUserID, nowAsJSONTime(), defaultNonBotUserID, nowAsJSONTime())
var defaultNonBotUser = fmt.Sprintf(`
"user": {
"id": "%s",
"team_id": "%s",
"name": "spengler",
"deleted": false,
"color": "9f69e7",
"real_name": "%s",
"tz": "America/Los_Angeles",
"tz_label": "Pacific Daylight Time",
"tz_offset": -25200,
"profile": {
"avatar_hash": "ge3b51ca72de",
"status_text": "Print is dead",
"status_emoji": ":books:",
"real_name": "%s",
"display_name": "spengler",
"real_name_normalized": "%s",
"display_name_normalized": "spengler",
"email": "[email protected]",
"image_24": "https://localhost.localdomain/avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
"image_32": "https://localhost.localdomain/avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
"image_48": "https://localhost.localdomain/avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
"image_72": "https://localhost.localdomain/avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
"image_192": "https://localhost.localdomain/avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
"image_512": "https://localhost.localdomain/avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
"team": "%s"
},
"is_admin": true,
"is_owner": false,
"is_primary_owner": false,
"is_restricted": false,
"is_ultra_restricted": false,
"is_bot": false,
"is_stranger": false,
"updated": 1502138686,
"is_app_user": false,
"has_2fa": false,
"locale": "en-US"
}
`, defaultNonBotUserID, defaultTeamID, defaultNonBotUserName, defaultNonBotUserName, defaultNonBotUserName, defaultTeamID)