Code Monkey home page Code Monkey logo

Comments (10)

lsmith77 avatar lsmith77 commented on September 26, 2024 1

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)}

from slack-export-viewer.

lsmith77 avatar lsmith77 commented on September 26, 2024 1

will look into creating a PR

from slack-export-viewer.

tscritch avatar tscritch commented on September 26, 2024

@future731 Are you thinking about opening a pull request for these features?

from slack-export-viewer.

MiraiHattori avatar MiraiHattori commented on September 26, 2024

@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.

from slack-export-viewer.

lsmith77 avatar lsmith77 commented on September 26, 2024

@future731 ping? :)

from slack-export-viewer.

MiraiHattori avatar MiraiHattori commented on September 26, 2024

@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.

from slack-export-viewer.

MiraiHattori avatar MiraiHattori commented on September 26, 2024

Sorry that I've accidentary closed this issue, and I reopened this.

from slack-export-viewer.

MiraiHattori avatar MiraiHattori commented on September 26, 2024

MiraiHattori@667e74c

The link above is the easiest workaround, but there are several reasons I didn't make a pull request.

  1. a bot can react with emoji, which makes hard to convert slack user id into slack username.
    Furthermore, even if we ignore bot emoji reaction, using self._message.get("reactions", [])[0].get("users") will return only slack user ids. SlackFormatter class member function "find_user(self, message)" needs message object.
  2. my workaround is sometimes ugly if the emoji text is long.
  3. I'm not familier with css style format, so I didn't do anything about css.

It'll be good to have reaction property in class Message though.

from slack-export-viewer.

lsmith77 avatar lsmith77 commented on September 26, 2024

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
        ]

from slack-export-viewer.

MiraiHattori avatar MiraiHattori commented on September 26, 2024

I think this issue is resolved thanks to @lsmith77

from slack-export-viewer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.