yashar1 / reddit-comment-bot Goto Github PK
View Code? Open in Web Editor NEWReddit bot that auto replies to comments on set subreddits
Reddit bot that auto replies to comments on set subreddits
How to post in example /ask/new ?
thankyou
Hello boot sleep duration not working
thank you
Edit, I'm dumb. I;m on the wrong git.
This great Bot 😃
can you add multy account feature ?
this will make powerfull
Hi,
I doubt this is an issue with your code but perhaps you could help since I can't seem to find anything on Google.
When testing the code in IDLE it keeps coming back with this:
Traceback (most recent call last):
File "C:\Users\thati\OneDrive\Desktop\comment.py", line 1, in
import praw
ImportError: No module named 'praw'
But I have praw installed. I've checked using help('modules') and it lists praw. I even installed using pip3. ot sure what is going on. This is a fresh install on a new PC and I haven't used python since college but it can't be that hard to install a module with the new python.
I also had to change all the "wording" to ("wording") to fix thaat syntax error and I'm not sure if that was a mistake. Again,. haven't used Python since college, which is about 9 years now.
So, minus the module issue I've made the appropriate changes, and changes I think might work (the quotes). I've changed my personal info to PERSONAL where I believe I'm supposed to add my info. Here is what I have so far:
import praw
import config
import time
import os
def bot_login():
print ("Logging in")
r = praw.Reddit(username = config.PERSONAL,
password = config.PERSONAL,
client_id = config.PERSONAL,
client_secret = config.PERSONAL,
user_agent = "The Reddit Commenter v1.0")
print ("Logged in!")
return r
def run_bot(r, comments_replied_to):
print ("Searching last 1,000 comments")
for comment in r.subreddit('test').comments(limit=1000):
if "You" in comment.body and comment.id not in comments_replied_to and comment.author != r.user.me():
print ("String with \"You\" found in comment ") + comment.id
comment.reply("Congrats, you are smarter than PERSONAL")
print ("Replied to comment ") + comment.id
comments_replied_to.append(comment.id)
with open ("comments_replied_to.txt", "a") as f:
f.write(comment.id + "\n")
print ("Search Completed.")
print (comments_replied_to)
print ("Sleeping for 10 seconds...")
#Sleep for 10 seconds...
time.sleep(10)
def get_saved_comments():
if not os.path.isfile("comments_replied_to.txt"):
comments_replied_to = []
else:
with open("comments_replied_to.txt", "r") as f:
comments_replied_to = f.read()
comments_replied_to = comments_replied_to.split("\n")
comments_replied_to = filter(None, comments_replied_to)
return comments_replied_to
r = bot_login()
comments_replied_to = get_saved_comments()
print (comments_replied_to)
while True:
run_bot(r, comments_replied_to)
How to make search criteria to Any New Post on my own subreddit?
Thank you.
Hello,
I’d like to scan for comments including line breaks, such as:
“This is a
comment”
And then reply with something like:
“Thank you
for your comment”
Is that possible with this bot? And is it as simple as putting in the appropriate “\n” - e.g. the reply would then be:
“Thank you\n\nfor your comment”
Would that work?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.