Closed MiraiHattori closed 5 years ago
@future731 Are you thinking about opening a pull request for these features?
@tscritch I've already fixed USLACKBOT issue in my local repository, so I'll send a pull request to that one and close the issue. I'm now struggling with this emoji one because it seems that emoji url is missing in archive json files. I don't think I'll create a pull request about the thread tracking one. Backquote one neither.
@future731 ping? :)
@lsmith77 pong. I'm struggling with this issue because we have to login the webpage to match the emoji email address. It's pretty easy to show bare text like "\:emoji-name\: by John, Mark"just after the msg text.
Sorry that I've accidentary closed this issue, and I reopened this.
https://github.com/future731/slack-export-viewer/commit/667e74c3717cb5c4add8f521597c575f4dde9932
The link above is the easiest workaround, but there are several reasons I didn't make a pull request.
It'll be good to have reaction property in class Message though.
indeed .. the user.py would need to be refactored to be able to handle user ids from reactions properly.
I tried to improve the code a bit but likely do to being a total python n00b this code is just producing empty reaction div's
{"usernames": [self._formatter.find_user(Message(self._formatter, {"user": user})).display_name for user in reaction.get("users")], "name": emoji.emojize(':'+reaction.get("name")+':', use_aliases=True)}
ok nevermind .. got it to work
def user_message(self, user_id):
return {"user": user_id}
def usernames(self, reaction):
return [
self._formatter.find_user(self.user_message(user_id)).display_name
for user_id
in reaction.get("users")
if self._formatter.find_user(self.user_message(user_id))
]
@property
def reactions(self):
reactions = self._message.get("reactions", [])
return [
{
"usernames": self.usernames(reaction),
"name": emoji.emojize(':'+reaction.get("name")+':', use_aliases=True)
}
for reaction in reactions
]
will look into creating a PR
I think this issue is resolved thanks to @lsmith77
It's better to show emoji reactions on messages.