A main object and 3 sets as I said, nothing complex (in fact working with sets is pretty easy) but a bit confusing.
When I save or update the main object I have to also call 3 times db.setAdd() or db.setRemove() depending on vote type (upvote, downvote or undo) but thats all.
Still new to NodeBB, but I think the chat is handled by Redis/MongoDB. While you can store files in MongoDB using GridFS, I would think a great way to tackle that would be to have the plugin upload the file to storage (like AWS S3) and then include in the body of the message a link to the downloaded file. Permissions could be set at upload to only allow members of the chat access to the file.