Both the submission and comment should have a "created_utc" field that you can access. praw.readthedocs.io/en/stable/code_overview/models/submission.html
Thanks so much! I've written my first bot in 3 hours after watching this video. I have a question though. My bot replies to comments and it keeps making me wait for 10 minutes after each comment. I even added a random (between 5-20 secs) delay after making each comment but it didn't fix it. I'm guessing it's because we're using test_bot as user agent but I'm not sure. How can I fix it?
This is most certainly reddit's automated system kicking in to limit new accounts. The only way around that is to get some karma on the bot account. You can read more about it here: www.reddit.com/r/NewToReddit/comments/p8t966/reddit_and_karma_explained/ Essentially, you're going to need to either post in subreddits in the hope of getting enough upvotes or obtain an account with enough karma by other means. I recommend in this video to use a new account because it's risky using a bot on your main account and so I look out for you in that regard, but this is one of the downsides of that. Hope this helps!
it will be more interesting if you add gpt that can comment based on what you gave him as prompt if it's possible to post a video like that will be much appreciated
I've had issues like this before and I usually just end up redoing the credentials setup steps and it works. I wouldn't know where to begin if that didn't work, maybe posting on the redditdev subreddit would be helpful if you get to that point.
I think I'm going to make a tutorial that uses the chatgpt api and then maybe one for your specific use case. I made a video about a year ago that was me using chatgpt to comment on Reddit so I might as well make a tutorial. Keep an eye out!
Reddit knows that you're using API access the moment you setup the user agent in reddit user prefs so I wouldn't say that praw adds an extra layer of noticeability. For the most part I've found that reddit doesn't care that you're botting an account so long as you're not breaking any other rules. Subreddits can make the decision to ban the bot on their own but they don't have access to your account details like whether or not you're using an API key and can only tell if the content it posts seems automated but I may be incorrect about that.
@@connorcreate thank you for your reply! I was wondering if i recreate the bot with python playwright == browser automation instead of API. Do you think that way accounts will have higher survival rate?
@@krissradev6708 I would say probably, though I would only worry about account survivability if you are actually breaking their rules. If you are staying within the bounds of reddits rules and even making accounts that just spit out chatgpt output you wouldn't have much issue keeping the account alive platform wide, you may just get banned from a subreddit when you post in it. But if you are specifically trying to avoid detection from reddit then browser simulation would be much better than this option.
@@connorcreate yea i am actually working with NSFW niches. thats my main concern. but again nsfw is not against reddit rules. i guess will have to find out
@@krissradev6708 yeah I remember there's some nuances with the new rules. I used to run some nsfw Discord bots that pulled from reddit using praw and it wasn't an issue back then but with the new API I don't think you're able to display images from the API.
It seems as though the consensus online is to make a new account with just password protection or you can try the unconfirmed method of resetting your password on your reddit account with google auth setup, though I'm not sure about that second option. Can also try a read only instance but the best option is to use a new account imo. praw.readthedocs.io/en/stable/getting_started/authentication.html#application-only-client-credentials-flow
@@connorcreatethanks dude, i tried everything, i ended up creating another account and your example worked perfect! i wanted to ask how can i include in image in my post? thanks a lot!
@hqcart1 To post an image just use the subreddit.submit_image() functionality like so. Make sure to change the image path to your image on the computer. title = "A picture" image = "/path/to/image.png" reddit_instance.subreddit("testingground4bots").submit_image(title, image) If you want to put an image in the selftext of your post you're going to want to use this code below. This will post an image to testingground4bots but you need to change the path specified in "path" to your local image. The {image1} is where the image should be inserted. from praw.models import InlineImage image = InlineImage(path="path/to/image.jpg", caption="optional caption") selftext = "Text with an image {image1}" reddit_instance.subreddit("testingground4bots").submit("title", inline_media=media, selftext=selftext)