What?
Currently the method GetReactions of the library returns only the reaction details, extracting them here:
|
func (res getReactionsResponseFull) extractReactions() []ItemReaction { |
|
switch res.Type { |
|
case "message": |
|
return res.M.Reactions |
|
case "file": |
|
return res.F.Reactions |
|
case "file_comment": |
|
return res.FC.Reactions |
|
} |
|
return []ItemReaction{} |
|
} |
It's fine, but Slack API's method also returns the details of the item itself, e.g., message:
{
"ok": true,
"type": "message",
"message": {
"type": "message",
"text": "Hi there!",
"user": "W123456",
"ts": "1648602352.215969",
"team": "T123456",
"reactions": [
{
"name": "grinning",
"users": [
"W222222"
],
"count": 1
},
{
"name": "question",
"users": [
"W333333"
],
"count": 1
}
],
"permalink": "https://xxx.slack.com/archives/C123456/p1648602352215969"
},
"channel": "C123ABC456"
}
So basically, part of the API response is being ignored.
It will be good if the library's response will be closer to Slack's and also start returning the item itself (message, file, file comment).
There was an issue, #117 where workarounds have been suggested, like using conversations.history, but the issue is that this workaround requires additional scopes, like channels:history.
Why?
Provide a library object that is closer to Slack
(Optional) Slack's documentation
https://docs.slack.dev/reference/methods/reactions.get/
What?
Currently the method
GetReactionsof the library returns only the reaction details, extracting them here:slack/reactions.go
Lines 49 to 59 in e6bc4a0
It's fine, but Slack API's method also returns the details of the item itself, e.g., message:
{ "ok": true, "type": "message", "message": { "type": "message", "text": "Hi there!", "user": "W123456", "ts": "1648602352.215969", "team": "T123456", "reactions": [ { "name": "grinning", "users": [ "W222222" ], "count": 1 }, { "name": "question", "users": [ "W333333" ], "count": 1 } ], "permalink": "https://xxx.slack.com/archives/C123456/p1648602352215969" }, "channel": "C123ABC456" }So basically, part of the API response is being ignored.
It will be good if the library's response will be closer to Slack's and also start returning the item itself (message, file, file comment).
There was an issue, #117 where workarounds have been suggested, like using conversations.history, but the issue is that this workaround requires additional scopes, like
channels:history.Why?
Provide a library object that is closer to Slack
(Optional) Slack's documentation
https://docs.slack.dev/reference/methods/reactions.get/