Create a Reddit Bot using Repl.it to host for free! Beginner Friendly.

  Рет қаралды 21,716

ClarityCoders

ClarityCoders

3 жыл бұрын

Repl.it is an amazing tool but can be intimidating. Today in this beginner friendly tutorial I will show you how to create and host a reddit bot on repl.it. You won't need to do any downloads or install any software on your PC. In just 30 minutes you will have a working project running 24/7 in the cloud!
If you don't care about Reddit try the tutorial anyway we show how to use repl.it database as well as create a webserver. This tutorial should be able to help you!
repl.it/@JacobLower4/OfficeBot
github.com/ClarityCoders/Redd...
Want to chat with me and other programmers join our discord!
/ discord
#python #replit #redditbot
Thanks to Poonam Agrawal for creating the ukulele cover featured in this video. You can check out her full cover of the song Titanium here: • Video .
Want to help support the channel?
www.buymeacoffee.com/clarityc...

Пікірлер: 121
@ClarityCoders
@ClarityCoders 3 жыл бұрын
REPLIT Changed .env file!!! Easy fix. 1. Click on Lock icon on left hand side of window. 2. Add key-value pairs using this GUI instead. Name them same as I do in video! 3. Code should work the same!
@COSMEREAUDIO
@COSMEREAUDIO 3 жыл бұрын
How it is not working
@MrRx29g
@MrRx29g 3 жыл бұрын
Replit mentions that 'the new UI is slowly rolling out to users' so .env is still in use
@mrgoats
@mrgoats 3 жыл бұрын
I'm I doing this right? import praw import os my_secret = os.environ['client_id'] my_secret = os.environ['client_secret'] my_secret = os.environ['username'] my_secret = os.environ['password']
@evancharles1182
@evancharles1182 2 жыл бұрын
I guess Im pretty off topic but does anybody know a good website to watch newly released series online?
@remingtonstetson905
@remingtonstetson905 2 жыл бұрын
@Evan Charles I watch on FlixZone. Just search on google for it =)
@Jjmmll
@Jjmmll 3 жыл бұрын
Literally what I was looking for, very well presented thanks very much!
@ClarityCoders
@ClarityCoders 3 жыл бұрын
Glad it helped! Thanks for watching I really appreciate it.
@joshuarmost
@joshuarmost 2 жыл бұрын
I think I finally found what I was looking for! Thank you!
@ClarityCoders
@ClarityCoders 2 жыл бұрын
My man! I hope so let us know if you have any questions.
@NonDomForever
@NonDomForever 3 жыл бұрын
Wow, this is such an amazing tutorial. Thanks!
@ClarityCoders
@ClarityCoders 3 жыл бұрын
Honestly after tough days these comments mean a lot thank you.
@NonDomForever
@NonDomForever 3 жыл бұрын
@@ClarityCoders It seems KZbin removed my comment so I am just asking this again since I have two questions. How would one monitor multiple subreddit streams and how would one be able to comment a large wall of text, like a guide, with a lot of newlines/empylines. Right now I get the error praw.exceptions.RedditAPIException: NO_TEXT: 'we need something here' on field 'text', when trying to comment larger amounts of text.
@imherovirat
@imherovirat 3 жыл бұрын
Ah what a timing, I badly wanted to learn praw, thanks Man :)
@ClarityCoders
@ClarityCoders 3 жыл бұрын
Glad I could help! Any questions let me know.
@zakyvids6566
@zakyvids6566 3 жыл бұрын
I”m new to programming and I love those bot making videos. I hope you can make more videos on making bots and automation as well as discuss bot ideas where we can make them etc ❤️❤️❤️❤️👍
@ClarityCoders
@ClarityCoders 2 жыл бұрын
More will be coming for sure stay tuned!
@lizard_ow7145
@lizard_ow7145 Жыл бұрын
excellent guide, thanks
@eduardomartinez6521
@eduardomartinez6521 3 жыл бұрын
Good video. Very clear and straightforward. I have a question, I'm planning to use Selenium and a Firefox web driver for a project in Python, does the Replit console installs the driver for me too or I have to add or install it by myself?
@ClarityCoders
@ClarityCoders 3 жыл бұрын
Good question I would have to look into that on the selenium side. I believe you can run it headless without the drivers but I could be wrong.
@TooFarGabe
@TooFarGabe 2 жыл бұрын
@ClarityCoders can you tell me how to tweak the code so that it responds to all the key phrases posted in the last 12 hours so that I can turn the bot on every 12 hours to do its daily posting? This would be easier for me than having it running 24-7
@mrgoats
@mrgoats 3 жыл бұрын
Any help to make it random responses to phrases? I watched your discord video but for someone not well rounded, I couldnt make a connection.
@xyz7572
@xyz7572 Жыл бұрын
What should I write to select several subreddits rather than just one or r/all ?
@nevkero4281
@nevkero4281 3 жыл бұрын
Can you also make a Reddit auto meme bot so it posts memes to subreddits?
@ClarityCoders
@ClarityCoders 3 жыл бұрын
That's a good idea!
@thepetersong
@thepetersong 2 жыл бұрын
Would you happen to know how to do formatting on the replies so that I could have paragraph breaks? i tried putting ' ' within the reply and the reddit comment the bot makes just includes " " and not the line break. Thank you!! this video was awesome
@atronoskronios6815
@atronoskronios6815 3 жыл бұрын
i updated the csv file but it still makes same comments! any way to fix this
@engineerbot
@engineerbot Жыл бұрын
Quick question: How would I have it monitor and reply to posts instead of comments?
@reeceytaylor
@reeceytaylor 2 жыл бұрын
How would I get the bot to ignore itself? It's picking up the trigger word in the response and stuck in a reply loop with itself
@flavioherrera3792
@flavioherrera3792 Жыл бұрын
one small issue, for some weird reason the bot will try to reply 3 times, then the rate limit starts working but not before i get rate limited by reddit itself. Not sure how to fix this.
@abrahaml1841
@abrahaml1841 3 жыл бұрын
Thanks man appreciate the hekp
@ClarityCoders
@ClarityCoders 3 жыл бұрын
Any time!
@thefitgentleman3541
@thefitgentleman3541 3 жыл бұрын
I can't get it to post, not sure where I've gone wrong, copied your files from Github and made some changes to the .env file and also the main script so it can occur on a 1-minute basis rather than daily basis but no idea where it's gone wrong.
@ClarityCoders
@ClarityCoders 3 жыл бұрын
Do you get any errors? Can you join our discord and we might be able to help! Can you get it to stream in comments?
@laraibsidd127
@laraibsidd127 2 жыл бұрын
Won't the bot stop if i close the browser or close my system?
@cempo8163
@cempo8163 3 жыл бұрын
There's a problem, when i try to create the .env file it says that i can create environment variables from the environment variables sidebar. What should i do?
@craftbee4303
@craftbee4303 2 жыл бұрын
look at the pinned comment
@r2kstories38
@r2kstories38 2 жыл бұрын
Hey @claritycoders . I created a reddit bot and it was all working fine and suddently it started showing a default_name error. even though everything seems to fine, How to fix this?
@ClarityCoders
@ClarityCoders 2 жыл бұрын
Not totally sure if you jump in discord and send code and error we can help. Make sure not to send your password!
@imjustdade3917
@imjustdade3917 2 жыл бұрын
is it possible in any way to make a webhook reddit bot?
@rterminatu
@rterminatu 2 жыл бұрын
I really don't want to store my password in plaintext. Is there a better way?
@Sam-vf5uc
@Sam-vf5uc Жыл бұрын
I keep getting an "invalid grant" error. After some googling it looks like that usually means bad credentials, but I've triple checked all of them and they're correct. Some other results suggest it may be a multi-factor authentication problem, but that account has MFA disabled. What else can be done to fix that?
@Sam-vf5uc
@Sam-vf5uc Жыл бұрын
Turns out I needed a better app name, I had one that was too generic and Reddit rejected it.
@notayush771
@notayush771 Жыл бұрын
I have a ques, if i want different replies to the same input (say, if someone says "happy" i want the bot to say 1 of the 5 qoutes i set up randomly) can I create duplicate csv's? (I mean in the excel sheet can i have more than one input to be the same (E.g.Happy:- don't be happy Happy:- Happiness 😊)
@unbenanntbekannt7569
@unbenanntbekannt7569 2 жыл бұрын
I'm somewhat lost, what do i need to put in the new .env file? I click on the lock and it wants some key and a value, what should i paste there?
@ClarityCoders
@ClarityCoders 2 жыл бұрын
Key is on the left side of the equal sign in my .env file the value is on the right. So for example client_secret for a key and the value should be the value for client_secret. Sorry for confusion they changed after I released the video.
@jacobweaver8505
@jacobweaver8505 Жыл бұрын
How would I do this but make the Bot log and store points based on interaction??
@ClarityCoders
@ClarityCoders Жыл бұрын
Great question join our discord and I'm sure someone could help you out.
@enriquerenteria6089
@enriquerenteria6089 2 жыл бұрын
Can I do this on vscode?
@ClarityCoders
@ClarityCoders 2 жыл бұрын
Of course!
@Nizart
@Nizart 3 жыл бұрын
what do i have to change if i want the repl.it to run once every hour?
@ClarityCoders
@ClarityCoders 3 жыл бұрын
Well right now its running constantly streaming in comments. You could have it check last 1000 comments ( praw limit ) try to post then sleep for an hour. Then repeat.
@rewindcat7927
@rewindcat7927 2 жыл бұрын
check out a package called 'node-chron'
@nushankodikara
@nushankodikara 3 жыл бұрын
You deserve more and more likes and views? I'm shocked
@ClarityCoders
@ClarityCoders 3 жыл бұрын
Thanks means a lot! As long as I get a few views I'll keep making them.
@QQ-gi3do
@QQ-gi3do 3 жыл бұрын
What happens if there are no comments on the post? How does one post a comment if there are no comments to begin with?
@ClarityCoders
@ClarityCoders 3 жыл бұрын
You could write something that comments based on the title of the post? possibilities are endless.
@QQ-gi3do
@QQ-gi3do 3 жыл бұрын
@@ClarityCoders I tried that but no luck, it only loops back to printing the title of the post
@necrobrqte5260
@necrobrqte5260 2 жыл бұрын
How can I create env file
@ClarityCoders
@ClarityCoders 2 жыл бұрын
On replit you would have to check there docs. In general I use virtualenv. Just pip install virtualenv then use virtualenv env
@gellertgrindelwald4374
@gellertgrindelwald4374 3 жыл бұрын
Repl.it disabled .env files, what should I do
@ClarityCoders
@ClarityCoders 3 жыл бұрын
REPLIT Changed .env file!!! Easy fix. 1. Click on Lock icon on left hand side of window. 2. Add key-value pairs using this GUI instead. Name them same as I do in video! 3. Code should work the same!
@neilMachado-rq8hz
@neilMachado-rq8hz 2 жыл бұрын
my bot goes offline after 1 hr ,even i have hacker plan and always on
@ClarityCoders
@ClarityCoders 2 жыл бұрын
Hit up their support it's pretty good that shouldn't happen.
@ju-yuanchueh8444
@ju-yuanchueh8444 2 жыл бұрын
I'm going to come back to this because I don't have time yet lol.
@ClarityCoders
@ClarityCoders 2 жыл бұрын
I'll be waiting 😉
@ju-yuanchueh8444
@ju-yuanchueh8444 2 жыл бұрын
@@ClarityCoders I did the code and was like why no comments but I was doing a subreddit that wasn't as popular lol
@ju-yuanchueh8444
@ju-yuanchueh8444 2 жыл бұрын
Actually it might be wrong because for the client secret part it says invalid syntax
@ju-yuanchueh8444
@ju-yuanchueh8444 2 жыл бұрын
I fixed that by rewriting it but now I have module object is not callable error.
@nevkero4281
@nevkero4281 3 жыл бұрын
Can you make a discord-to-Reddit bot?
@ClarityCoders
@ClarityCoders 3 жыл бұрын
Sure. I have one that is the opposite think of what you mean that runs on my discord. It posts popular things from Reddit to our Discord.
@nevkero4281
@nevkero4281 3 жыл бұрын
@@ClarityCoders Cool
@nevkero4281
@nevkero4281 3 жыл бұрын
@@ClarityCoders It would be great for growing small subreddits
@diablolaggo870
@diablolaggo870 3 жыл бұрын
@@ClarityCoders ummm.. where can I find it? Also.. a discord to reddit would be cool... Jus like redditcord
@thegovtdoesntcareaboutyou
@thegovtdoesntcareaboutyou Жыл бұрын
.env doesn't work
@aguythatexists8318
@aguythatexists8318 3 жыл бұрын
So uh I think I did something wrong but I'm not sure what I added 1 key value pair per line of code in your env file and I named the keys random names I did not change anything else about the code the problem is that when I try to run it, it presents me with an error message where all I can decipher is "client_id missing"
@ClarityCoders
@ClarityCoders 3 жыл бұрын
don't give them random names! the names have to be exactly same as mine like "client_id" the value being your client I'd instead of mine.
@aguythatexists8318
@aguythatexists8318 3 жыл бұрын
@@ClarityCoders ohhhhhhhhhh
@ZyloGG
@ZyloGG 3 жыл бұрын
Plz make an updated version
@ClarityCoders
@ClarityCoders 3 жыл бұрын
I may make a few more. what would you like to see updated?
@ZyloGG
@ZyloGG 3 жыл бұрын
@@ClarityCoders we cant use .env files . You should make a new tutorial on how to create a reddit bot using Repl.it
@ClarityCoders
@ClarityCoders 3 жыл бұрын
check my comment on it! it's really easy none of the code changes. I will look into it though!
@ZyloGG
@ZyloGG 3 жыл бұрын
@@ClarityCoders wdym “on it”.... like in the replit ?
@ClarityCoders
@ClarityCoders 3 жыл бұрын
@@ZyloGG REPLIT Changed .env file!!! Easy fix. 1. Click on Lock icon on left hand side of window. 2. Add key-value pairs using this GUI instead. Name them same as I do in video! 3. Code should work the same!
@lilystic9623
@lilystic9623 2 жыл бұрын
16:27
@torpid
@torpid 3 жыл бұрын
u/have_a_nice_day_bot
@ClarityCoders
@ClarityCoders 3 жыл бұрын
Good bot.
@anorintarsus
@anorintarsus 2 жыл бұрын
7:26 bizim herif koyun kırpan'ı böyle yapmış demek.
@user-nn6ez3zk8o
@user-nn6ez3zk8o 9 ай бұрын
How do I make him comment more frequently?
@labhjoshi3182
@labhjoshi3182 9 ай бұрын
does yours work?
@blackheartkiss1441
@blackheartkiss1441 3 жыл бұрын
can you show us how to create an upvote bot
@ClarityCoders
@ClarityCoders 3 жыл бұрын
So a bot that up votes a certain persons post every time?
@blackheartkiss1441
@blackheartkiss1441 3 жыл бұрын
@@ClarityCoders yes, more than once though, something that pushes a post to the top of a subreddit
@ClarityCoders
@ClarityCoders 3 жыл бұрын
That's going to have issues that is a little to hacky and out of my area a bit. Reddit will detect this manipulation if you use the same IP address.
@necrobrqte5260
@necrobrqte5260 2 жыл бұрын
POV: this bot is not for discord
@ClarityCoders
@ClarityCoders 2 жыл бұрын
Nope it's for reddit! I have one for discord though using replit. kzbin.info/www/bejne/rZu0aoGfo5dkmpo
@miketrayven6060
@miketrayven6060 3 жыл бұрын
Looks like creating env files is now depricated in repl. - Was following your video and the only way I'm able to get this to work is by declaring the auth credentials statically. However, this is not ideal because then it makes my info public. I've tried doing it using the env vars in repl like this: import os import praw reddit = praw.Reddit(client_id=os.getenv("client_id"), client_secret=os.getenv("client_secret"), password=os.getenv("password"), user_agent="testscript by u/testbot", username=os.getenv("username")) print(reddit.user.me()) But I keep getting an error. - Any idea what I'm doing wrong? I'm pretty new to Python and just stuck on this part. Thanks in advance!
@jerukpurut369
@jerukpurut369 3 жыл бұрын
Hey Man just want you to know that repl.it disabled .env file for good
@ClarityCoders
@ClarityCoders 3 жыл бұрын
thanks for heads up!
@jerukpurut369
@jerukpurut369 3 жыл бұрын
@@ClarityCoders No prob ^_^
@codyswanson
@codyswanson 2 жыл бұрын
I keep getting this error: Traceback (most recent call last): File "main.py", line 5, in reddit = praw.Reddit( File "/opt/virtualenvs/python3/lib/python3.8/site-packages/praw/reddit.py", line 249, in __init__ raise MissingRequiredAttributeException( praw.exceptions.MissingRequiredAttributeException: Required configuration setting 'client_id' missing. This setting can be provided in a praw.ini file, as a keyword argument to the `Reddit` class constructor, or as an environment variable. If it has something to do with the lock/environment variable, I've seen every response you've made about how to enter this in, and none of them actually explain what to put where and how to format it so it works. Can you please explain this in just a little more detail?
@nuclearcrypto
@nuclearcrypto 2 жыл бұрын
Have the same problem, have you found any solutions yet?
@ClarityCoders
@ClarityCoders 2 жыл бұрын
you code is missing the client_id when you call the function can you share that bit of your code? find out discord and post it there.
@M5J72XrtvEa24XteAIdNGA
@M5J72XrtvEa24XteAIdNGA 3 жыл бұрын
!gnir eht ni rednetnoc wen a worht dna ,gniht ykaens a od annog m'I ,etanutrofun woH 1ho-Hu !etanutrofnu woH !ho-hU
@edrianbinasoy338
@edrianbinasoy338 3 жыл бұрын
[::-1]
AI Destroys a Mobile Game in Real-Time with OpenCV (Object Detection)
12:18
Building a simple Instagram Bot in 2020
26:32
ClarityCoders
Рет қаралды 14 М.
I Built a Shelter House For myself and Сat🐱📦🏠
00:35
TooTool
Рет қаралды 28 МЛН
I tried to make a Valorant AI using computer vision
19:23
River's Educational Channel
Рет қаралды 1,4 МЛН
Code a Discord Bot with Python - Host for Free in the Cloud
1:08:28
freeCodeCamp.org
Рет қаралды 2,3 МЛН
Learn How to Make a Python Discord Bot in 17 Minutes. Host for Free!
17:14
Using My Python Skills To Punish Credit Card Scammers
7:13
Engineer Man
Рет қаралды 4,8 МЛН
Python bot that makes movies and posts them daily to YouTube.
27:07
ClarityCoders
Рет қаралды 91 М.
Python dataclasses will save you HOURS, also featuring attrs
8:50
FastAI learns to play Fall Guys - Undetectable Fall Guys bot.
12:13
ClarityCoders
Рет қаралды 794 М.
Using Python and YouTube API  to Create Analytics on any Channel.
46:50
#miniphone
0:16
Miniphone
Рет қаралды 2,1 МЛН
Best Beast Sounds Handsfree For Multi Phone
0:42
MUN HD
Рет қаралды 340 М.
сюрприз
1:00
Capex0
Рет қаралды 926 М.
Apple watch hidden camera
0:34
_vector_
Рет қаралды 58 МЛН
Will the battery emit smoke if it rotates rapidly?
0:11
Meaningful Cartoons 183
Рет қаралды 6 МЛН