Closed slatinsky closed 1 year ago
In the last commit:
IEnumerable<Role> TryGetUserRoles(...)
to IReadOnlyList<Role> GetUserRoles(...)
TryGetUserColor(...)
Thanks!
Hey, thanks for change. Was there some consideration about how large the file will get with this change? Is it recorded really for each message including on servers with 100s of roles? What about creating extra file during export, which would hold just dictionary of users and their corresponding roles, while removing that information from channel export?
Discord limits roles to 250 per server. That is the edge case scenario, but many users in my experience have only small number of roles. Yes, it is recorded in every message. You could deduplicate a lot of things if you really wanted - reactions, authors, mentions, stickers. This felt like the best place to put it considering the current state of the project. Yes, it will increase the file size. But text size increase is minimal in my opinion vs. the size of assets. And hard drive space is very cheap. And we were fetching this information anyway, just not recording it in the file.
This pull request adds
roles
field tomessages.author
in JSON output format.If no roles are available, empty array is created:
If role color is not available,
null
value is used. Else the color is is converted to hexcodeRoles are sorted by position, as they are in the Discord client
Tested CLI export in Json format - DM channel (no roles) and Guild channel (with roles). \ GUI not tested, but the changes should not affect it.