PRAW post image

· 1 minute de lecture
PRAW post image

For example, to submit a self post with inline media do:


from praw.models import InlineGif, InlineImage, InlineVideo

gif = InlineGif(path="path/to/image.gif", caption="optional caption")
image = InlineImage(path="path/to/image.jpg", caption="optional caption")
video = InlineVideo(path="path/to/video.mp4", caption="optional caption")
selftext = "Text with a gif {gif1} an image {image1} and a video {video1} inline"
media = {"gif1": gif, "image1": image, "video1": video}

reddit.subreddit("test").submit("title", inline_media=media, selftext=selftext)