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

Поделиться
HTML-код
  • Опубликовано: 28 фев 2021
  • 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 года назад +20

    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 года назад +13

    Literally what I was looking for, very well presented thanks very much!

    • @ClarityCoders
      @ClarityCoders  3 года назад +2

      Glad it helped! Thanks for watching I really appreciate it.

  • @joshuarmost
    @joshuarmost 2 года назад +3

    I think I finally found what I was looking for! Thank you!

    • @ClarityCoders
      @ClarityCoders  2 года назад +2

      My man! I hope so let us know if you have any questions.

  • @NonDomForever
    @NonDomForever 3 года назад +6

    Wow, this is such an amazing tutorial. Thanks!

    • @ClarityCoders
      @ClarityCoders  3 года назад +2

      Honestly after tough days these comments mean a lot thank you.

    • @NonDomForever
      @NonDomForever 3 года назад

      @@ClarityCoders It seems RUclips 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.

  • @zakyvids6566
    @zakyvids6566 2 года назад +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 года назад +2

      More will be coming for sure stay tuned!

  • @imherovirat
    @imherovirat 3 года назад +6

    Ah what a timing, I badly wanted to learn praw, thanks Man :)

    • @ClarityCoders
      @ClarityCoders  3 года назад +2

      Glad I could help! Any questions let me know.

  • @lizard_ow7145
    @lizard_ow7145 Год назад +1

    excellent guide, thanks

  • @eduardomartinez6521
    @eduardomartinez6521 3 года назад +4

    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 года назад +2

      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 года назад +1

    @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 2 года назад +1

    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.

  • @thepetersong
    @thepetersong 2 года назад +1

    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

  • @xyz7572
    @xyz7572 Год назад +1

    What should I write to select several subreddits rather than just one or r/all ?

  • @atronoskronios6815
    @atronoskronios6815 2 года назад +1

    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?

  • @abrahaml1841
    @abrahaml1841 3 года назад +1

    Thanks man appreciate the hekp

  • @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.

  • @thefitgentleman3541
    @thefitgentleman3541 3 года назад +2

    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 года назад +1

      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?

  • @imjustdade3917
    @imjustdade3917 2 года назад

    is it possible in any way to make a webhook reddit bot?

  • @nevkero4281
    @nevkero4281 3 года назад +7

    Can you also make a Reddit auto meme bot so it posts memes to subreddits?

  • @laraibsidd127
    @laraibsidd127 2 года назад

    Won't the bot stop if i close the browser or close my system?

  • @r2kstories38
    @r2kstories38 2 года назад +1

    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 года назад +1

      Not totally sure if you jump in discord and send code and error we can help. Make sure not to send your password!

  • @Sam-vf5uc
    @Sam-vf5uc Год назад +1

    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.

  • @cempo8163
    @cempo8163 2 года назад +1

    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 года назад +1

      look at the pinned comment

  • @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 😊)

  • @rterminatu
    @rterminatu 2 года назад

    I really don't want to store my password in plaintext. Is there a better way?

  • @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 года назад +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.

  • @Nizart
    @Nizart 3 года назад +1

    what do i have to change if i want the repl.it to run once every hour?

    • @ClarityCoders
      @ClarityCoders  3 года назад +1

      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 года назад +1

      check out a package called 'node-chron'

  • @QQ-gi3do
    @QQ-gi3do 3 года назад +1

    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

  • @enriquerenteria6089
    @enriquerenteria6089 2 года назад +2

    Can I do this on vscode?

  • @nushankodikara
    @nushankodikara 3 года назад +2

    You deserve more and more likes and views? I'm shocked

    • @ClarityCoders
      @ClarityCoders  3 года назад +1

      Thanks means a lot! As long as I get a few views I'll keep making them.

  • @gellertgrindelwald4374
    @gellertgrindelwald4374 3 года назад

    Repl.it disabled .env files, what should I do

    • @ClarityCoders
      @ClarityCoders  3 года назад +1

      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!

  • @necrobrqte5260
    @necrobrqte5260 2 года назад +1

    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

  • @ju-yuanchueh8444
    @ju-yuanchueh8444 2 года назад

    I'm going to come back to this because I don't have time yet lol.

    • @ClarityCoders
      @ClarityCoders  2 года назад +1

      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 года назад +2

    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

  • @ZyloGG
    @ZyloGG 3 года назад +1

    Plz make an updated version

    • @ClarityCoders
      @ClarityCoders  3 года назад +2

      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 года назад +2

      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 года назад +2

      @@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!

  • @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.

  • @lilystic9623
    @lilystic9623 2 года назад

    16:27

  • @aguythatexists8318
    @aguythatexists8318 2 года назад

    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  2 года назад

      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 2 года назад

      @@ClarityCoders ohhhhhhhhhh

  • @torpid
    @torpid 3 года назад +1

    u/have_a_nice_day_bot

  • @user-nn6ez3zk8o
    @user-nn6ez3zk8o 8 месяцев назад

    How do I make him comment more frequently?

  • @anorintarsus
    @anorintarsus 2 года назад

    7:26 bizim herif koyun kırpan'ı böyle yapmış demek.

  • @miketrayven6060
    @miketrayven6060 3 года назад +1

    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!

  • @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. ruclips.net/video/wjQ9Nin21d8/видео.html

  • @jerukpurut369
    @jerukpurut369 3 года назад +2

    Hey Man just want you to know that repl.it disabled .env file for good

  • @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