devvit icon indicating copy to clipboard operation
devvit copied to clipboard

Add author flair data to Post and Comment objects

Open PitchforkAssistant opened this issue 1 year ago • 1 comments

The .json endpoints for posts and comments in the data API contain:

  • author_flair_template_id
  • author_flair_css_class
  • author_flair_richtext
  • author_flair_text_color
  • author_flair_text
  • author_flair_type
  • author_flair_background_color

These are quite hard to access via Devvit. Some of them are exposed in the event data for some triggers, but that's not a reliable way to get them. The User.getUserFlairBySubreddit() method only exposes author_flair_text and author_flair_css_class.

I understand there are difficulties with adding more flair data to the User object, so in the interim adding it to the Post and Comment objects would make obtaining things like a user's flair template ID far more reliable.

PitchforkAssistant avatar Oct 18 '24 20:10 PitchforkAssistant

It appears I may be able to expose this data myself. It is already passed into the Post and Comment object constructors in the protos data, so it's just a matter of adding and setting those properties.

PitchforkAssistant avatar Nov 18 '24 17:11 PitchforkAssistant