aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--slack/slack_conversation.py12
-rw-r--r--slack/slack_message.py5
2 files changed, 15 insertions, 2 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
diff --git a/slack/slack_message.py b/slack/slack_message.py
index 0771b60..36faa5f 100644
--- a/slack/slack_message.py
+++ b/slack/slack_message.py
@@ -217,6 +217,10 @@ class SlackMessage:
return await self.workspace.bots[self._message_json["bot_id"]]
@property
+ def reactions(self) -> List[SlackMessageReaction]:
+ return self._message_json.get("reactions", [])
+
+ @property
def priority(self) -> MessagePriority:
return MessagePriority.MESSAGE
@@ -603,7 +607,6 @@ class SlackMessage:
async def _create_reaction_string(self, reaction: SlackMessageReaction) -> str:
if self.conversation.display_reaction_nicks():
- # TODO: initialize_items?
users = await gather(
*(self.workspace.users[user_id] for user_id in reaction["users"])
)