Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PRAW: Replying to a post

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.

like image 338
agsl Avatar asked Aug 03 '14 00:08

agsl


1 Answers

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.")
like image 103
Ian Stapleton Cordasco Avatar answered Oct 06 '22 01:10

Ian Stapleton Cordasco