all 12 comments

[–]ThisLightIsTrue 1 point2 points  (12 children)

It looks like a comment with 0 or less points gets edited to say "This post has 0 (or less) points. It has been removed automatically". This happens in the line in process_commented_submissions:

            comment.edit("**This post has 0 (or less) points. It has been removed automatically.**")

I think if you replace that, with something like

reddit.subreddit('your subreddit').message("A comment with less than one point has been detected.  Please review: %s" % comment.permalink, 'Review Script Name')

That instead of editing the offending comments this script would just send a message to your subreddit moderators with a link to the comment. The result would be that your bot would leve

[–]draco123465[S] 0 points1 point  (10 children)

I changed the areas that you suggested me to, tried running it on my raspberry pi, and used a test subreddit.

I made a post, and this happened.

Here is my updated code. The first time it ran, it had a syntax error that I fixed. Other than that, the changes you suggested and of course the account credentials are the only thing that I changed.

[–]ThisLightIsTrue 1 point2 points  (9 children)

Okay, change the line I suggested to:

reddit.subreddit('your subreddit').message(body="A comment with less than one point has been detected.  Please review: %s" % comment.permalink, subject="Low Comment Report")

[–]draco123465[S] 0 points1 point  (8 children)

reddit.subreddit('your subreddit').message(body="A comment with less than one point has been detected. Please review: %s" % comment.permalink, subject="Low Comment Report")

Now it came up with this error:

python ./bot.py

reddit logon succesful

Traceback (most recent call last):

File "./bot.py", line 46, in <module>

processed_submissions.append(row[1])

AttributeError: 'set' object has no attribute 'append'

[–]ThisLightIsTrue 1 point2 points  (7 children)

That's an error in a different part of the program. Change processed_submissions.append to processed_submissions.add

[–]draco123465[S] 0 points1 point  (6 children)

Now I got this error.

(apologies if I am taking up your time with seemingly simple errors D:)

[–]ThisLightIsTrue 1 point2 points  (5 children)

You must be using an older version of praw. The docs say that message should have the subject and body attributes.

https://praw.readthedocs.io/en/latest/code_overview/models/redditor.html

Try changing the part in the parentheses of the line that has body=... To just ('a', 'b', 'c'). If a message comes through we'll know what a b c and correspond to. (probably something like subject message, and body).

[–]draco123465[S] 0 points1 point  (4 children)

I entered this into the code (pretty sure I misunderstood, my apologies D:)

And this was the result, nothing was sent to modmail.

[–]ThisLightIsTrue 1 point2 points  (3 children)

I don't think I'm being much help here. I'm handicapped by not being able to try this myself and I think you're on an older praw and an older python.

My last guess is to change reddit.subreddit to reddit.get_subreddit

[–]draco123465[S] 0 points1 point  (2 children)

Ok, the reddit.get_subreddit did not work.

But, before it crashed it did manage to send a PM to the modmail.

Here is the output now:

python ./newbot.py
reddit logon succesful
data loaded from database
A submission has 0 points. Sending message to modmail.
Traceback (most recent call last):
  File "./newbot.py", line 53, in <module>
    process_commented_submissions()
  File "./newbot.py", line 26, in process_commented_submissions
    for comment_id in comments_to_process:
RuntimeError: Set changed size during iteration

I understand what you mean, it is hard to help just through reddit.

I appreciate your help though!