Codebase list golang-github-nlopes-slack / 0b16c89
more json structure fixes Ryan Carver 8 years ago
2 changed file(s) with 32 addition(s) and 39 deletion(s). Raw diff Collapse all Expand all
6464 Reactions []ItemReaction
6565 } `json:"file"`
6666 FC struct {
67 Comment struct {
68 Reactions []ItemReaction
69 }
70 } `json:"file_comment"`
67 Reactions []ItemReaction
68 } `json:"comment"`
7169 SlackResponse
7270 }
7371
7876 case "file":
7977 return res.F.Reactions
8078 case "file_comment":
81 return res.FC.Comment.Reactions
79 return res.FC.Reactions
8280 }
8381 return []ItemReaction{}
8482 }
121119 Reactions []ItemReaction
122120 } `json:"file"`
123121 FC struct {
124 C struct {
125 *Comment
126 Reactions []ItemReaction
127 } `json:"comment"`
128 } `json:"file_comment"`
122 *Comment
123 Reactions []ItemReaction
124 } `json:"comment"`
129125 }
130126 Paging `json:"paging"`
131127 SlackResponse
145141 item.File = input.F.File
146142 item.Reactions = input.F.Reactions
147143 case "file_comment":
148 item.Comment = input.FC.C.Comment
149 item.Reactions = input.FC.C.Reactions
144 item.Comment = input.FC.Comment
145 item.Reactions = input.FC.Reactions
150146 }
151147 items[i] = item
152148 }
201201 },
202202 `{"ok": true,
203203 "type": "file_comment",
204 "file_comment": {
205 "comment": {
206 "reactions": [
207 {
208 "name": "astonished",
209 "count": 3,
210 "users": [ "U1", "U2", "U3" ]
211 },
212 {
213 "name": "clock1",
214 "count": 3,
215 "users": [ "U1", "U2" ]
216 }
217 ]
218 }
204 "file": {},
205 "comment": {
206 "reactions": [
207 {
208 "name": "astonished",
209 "count": 3,
210 "users": [ "U1", "U2", "U3" ]
211 },
212 {
213 "name": "clock1",
214 "count": 3,
215 "users": [ "U1", "U2" ]
216 }
217 ]
219218 }}`,
220219 []ItemReaction{
221220 ItemReaction{Name: "astonished", Count: 3, Users: []string{"U1", "U2", "U3"}},
282281 },
283282 {
284283 "type": "file_comment",
285 "file_comment": {
286 "file": {},
287 "comment": {
288 "comment": "cool toy",
289 "reactions": [
290 {
291 "name": "astonished",
292 "count": 3,
293 "users": [ "U1", "U2", "U3" ]
294 }
295 ]
296 }
284 "file": {},
285 "comment": {
286 "comment": "cool toy",
287 "reactions": [
288 {
289 "name": "astonished",
290 "count": 3,
291 "users": [ "U1", "U2", "U3" ]
292 }
293 ]
297294 }
298295 }
299296 ],