Hello everyone I’m making a Reddit bot but I keep having the error ‘Submission’ object has no attribute ‘comment’ I don’t know what’s causing it so that’s why I am asking here
Code:
import praw
import os
from praw import reddit
client_id = os.environ['client_id']
client_secret = os.environ['client_secret']
username = os.environ['username']
password = os.environ['password']
reddit = praw.Reddit(
client_id = client_id,
client_secret = client_secret,
username = username,
password = password,
user_agent = "<antiH-bot9000 1.0>"
)
def run():
try:
for comment in reddit.subreddit("crispybeatle").stream.submissions(skip_existing=True):
print("new comment")
comment.comment("h is bad")
print("replied")
except Exception as e:
print(e)
run()
run()