class praw.models.reddit.subreddit.SubredditFlairTemplates(subreddit: praw.models.Subreddit)

Provide functions to interact with a Subreddit’s flair templates.

__init__(subreddit: praw.models.Subreddit)

Create a SubredditFlairTemplate instance.


subreddit – The subreddit whose flair templates to work with.


This class should not be initialized directly. Instead obtain an instance via: reddit.subreddit("subreddit_name").flair.templates or reddit.subreddit("subreddit_name").flair.link_templates.


Abstract method to return flair templates.

delete(template_id: str)

Remove a flair template provided by template_id.

For example, to delete the first Redditor flair template listed, try:

template_info = list(subreddit.flair.templates)[0]
static flair_type(is_link: bool) str

Return LINK_FLAIR or USER_FLAIR depending on is_link value.

update(template_id: str, text: Optional[str] = None, css_class: Optional[str] = None, text_editable: Optional[bool] = None, background_color: Optional[str] = None, text_color: Optional[str] = None, mod_only: Optional[bool] = None, allowable_content: Optional[str] = None, max_emojis: Optional[int] = None, fetch: bool = True)

Update the flair template provided by template_id.

  • template_id – The flair template to update. If not valid then an exception will be thrown.

  • text – The flair template’s new text (required).

  • css_class – The flair template’s new css_class (default: “”).

  • text_editable – (boolean) Indicate if the flair text can be modified for each Redditor that sets it (default: False).

  • background_color – The flair template’s new background color, as a hex color.

  • text_color – The flair template’s new text color, either "light" or "dark".

  • mod_only – (boolean) Indicate if the flair can only be used by moderators.

  • allowable_content – If specified, most be one of "all", "emoji", or "text" to restrict content to that type. If set to "emoji" then the "text" param must be a valid emoji string, for example, ":snoo:".

  • max_emojis – (int) Maximum emojis in the flair (Reddit defaults this value to 10).

  • fetch – Whether or not PRAW will fetch existing information on the existing flair before updating (Default: True).


If parameter fetch is set to False, all parameters not provided will be reset to default (None or False) values.

For example, to make a user flair template text_editable, try:

template_info = list(subreddit.flair.templates)[0]
    template_info["id"], template_info["flair_text"], text_editable=True