PRAW: Replying to a post
Asked Answered
M

2

7

As the title says, I'm unable to find the function in PRAW to reply to a post on Reddit.

I've written a rather simple bot so far, which looks for new posts on a certain subreddit. My problem is that once finding the submission, I can't find how to post a reply to it.

Morocco answered 3/8, 2014 at 0:46 Comment(0)
E
8

It's unclear if by "submission" you mean a submission to reddit or if you're referencing a comment on a submission to reddit. If it's the former, you're looking for the Submission#add_comment method. If you have the submission bound to variable name s, then you can do the following:

s.add_comment('This is my comment. There are many like it, but this one is mine.')

If you're looking for how to reply to a comment, you want to use the Comment#reply method. If you have the comment bound to variable name c, then you can do the following:

c.reply("Here is a reply to your comment.")
Exsert answered 3/8, 2014 at 1:4 Comment(0)
S
5

As of October 2018, submission.add_comment() is no longer possible in PRAW.

The new call is submission.reply()

Savarin answered 31/10, 2018 at 12:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.