Search code examples
pythonpython-3.xredditprawflair

PRAW Posting new submission with a flair?


Trying to post to a subreddit that requires flairs

reddit.subreddit('test').submit(title,url=link,flair_id='')

i didn't know how to find the flair_id of a subreddit ?

also when I try to share an image with praw using

Trying to post to a subreddit that requires flairs

reddit.subreddit('').submit_image(title,image_path=image,flair_id='')

how should i write the image path ?


Solution

  • You can find the available flair ids with

    reddit.subreddit("test").flair.templates
    

    The image path is a path relative to the script

    ex.

    script/
         - main.py
         - image.png
    
    reddit.subreddit('').submit_image(title, image_path="image.png")