Comments (10)
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.
will look into creating a PR
from slack-export-viewer.
@future731 Are you thinking about opening a pull request for these features?
from slack-export-viewer.
@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.
@future731 ping? :)
from slack-export-viewer.
@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.
Sorry that I've accidentary closed this issue, and I reopened this.
from slack-export-viewer.
The link above is the easiest workaround, but there are several reasons I didn't make a pull request.
- 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. - my workaround is sometimes ugly if the emoji text is long.
- 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.
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.
I think this issue is resolved thanks to @lsmith77
from slack-export-viewer.
Related Issues (20)
- New release HOT 1
- Offline/local retrieval of data? HOT 1
- Error 500 / KeyError: 'ts' HOT 8
- Integration with slack-exporter?
- Access to local Host Denied HOT 3
- Not able to view the exported dump HOT 6
- slack-export-viewer fails at flask\__init__.py", line 60, in __getattr__ raise AttributeError(name) HOT 9
- Static HTML export fails with AttributeError: 'str' object has no attribute 'mkdir' HOT 5
- Nothing but a Blank Page
- UnicodeEncodeError: 'charmap' codec can't encode character '\u202f' in position 54: character maps to <undefined> encoding with 'cp437' codec failed HOT 4
- Resize sidebar
- slackdump exports aren't viewable using slack-export-viewer HOT 1
- [Feature Request] Allow updating the base URL for reverse proxies
- xxx.zip is not a zipfile
- Feature request: ignore join/leave messages
- Feature request: hide usernames
- CSS is missing when running without external sources
- Viewer will not open
- Bug encoding of urls
- Access to localhost was deniedYou don't have authorization to view this page. HTTP ERROR 403 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slack-export-viewer.