class asyncpraw.models.reddit.submission.SubmissionFlair(submission: asyncpraw.models.Submission)

Provide a set of functions pertaining to Submission flair.

__init__(submission: asyncpraw.models.Submission)

Initialize a SubmissionFlair instance.


submission – The Submission associated with the flair functions.

await choices() List[Dict[str, bool | list | str]]

Return list of available flair choices.

Choices are required in order to use select().

For example:

choices = await submission.flair.choices()
await select(flair_template_id: str, *, text: str | None = None)

Select flair for submission.

  • flair_template_id – The flair template to select. The possible values can be discovered through choices().

  • text – If the template’s flair_text_editable value is True, this value will set a custom text (default: None).

For example, to select an arbitrary editable flair text (assuming there is one) and set a custom value try:

choices = await submission.flair.choices()
template_id = next(x for x in choices if x["flair_text_editable"])["flair_template_id"]
await, text="my custom value")