diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-09-30 23:31:05 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:54 +0100 |
commit | 9c121f76db9285ffc06388bd899c88ce01a2c73a (patch) | |
tree | e838615a59254eb4f4815bccdc47138bca6f0c58 /slack/slack_conversation.py | |
parent | a9265419397256cb6c3bd944aab38b7f1d4a6990 (diff) | |
download | wee-slack-9c121f76db9285ffc06388bd899c88ce01a2c73a.tar.gz |
Get all reaction users in one request
Diffstat (limited to 'slack/slack_conversation.py')
-rw-r--r-- | slack/slack_conversation.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/slack/slack_conversation.py b/slack/slack_conversation.py index 2d6fc3b..97fd85b 100644 --- a/slack/slack_conversation.py +++ b/slack/slack_conversation.py @@ -313,7 +313,17 @@ class SlackConversation(SlackBuffer): ] sender_user_ids = [m.sender_user_id for m in messages if m.sender_user_id] - self.workspace.users.initialize_items(sender_user_ids) + if self.display_reaction_nicks(): + reaction_user_ids = [ + user_id + for m in messages + for reaction in m.reactions + for user_id in reaction["users"] + ] + user_ids = sender_user_ids + reaction_user_ids + else: + user_ids = sender_user_ids + self.workspace.users.initialize_items(user_ids) sender_bot_ids = [ m.sender_bot_id |