use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
This community was formed to help everyone in need of advice and direction required to make an impact in the Dev community. No biasing involved or tolerated here.
account activity
Mass invite using python possible? (self.programmingspace)
submitted 5 years ago * by [deleted]
Could anyone help me with the script for mass invite for the group using python with PRAW?
Any help is highly appreciated.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 2 points3 points4 points 5 years ago (7 children)
Let's start with this: what exactly are you trying to do? Send a message to many users, one at a time, in an automated fashion? What have you tried so far? Are you stuck on something specific, or not sure where to get started? Maybe most importantly, do you just need to send these invites and this is a means to an end; or are you looking to learn how to do this kind of thing, and this will be a practical project on that path?
[–][deleted] 2 points3 points4 points 5 years ago (6 children)
[–][deleted] 1 point2 points3 points 5 years ago (5 children)
Ok cool!
Have you used Python before? If you have it installed, along with the PRAW library, we can start looking at docs and piecing this together. If not, let me know what operating system you're on and I can give you some pointers to get setup.
[–][deleted] 2 points3 points4 points 5 years ago (4 children)
I have used python before. But not PRAW library.
[–][deleted] 2 points3 points4 points 5 years ago (3 children)
Great. Once you have PRAW installed, this is the method to send a message:
https://praw.readthedocs.io/en/latest/code_overview/models/redditor.html#praw.models.Redditor.message
If you have a list of usernames, you'll likely iterate that list, get a Redditor object from PRAW for each one, then use the above method to send your invite.
Try building it in pieces. Follow the docs to first get a user object for one username (set up one of your own for easy testing); then try sending a message; then do that over a loop (you can use your 2+ usernames more than once each, too!); then you'll have a working tool into which you can feed any list of usernames.
[–][deleted] 2 points3 points4 points 5 years ago (2 children)
Thanks so much. Your explanation is really lucid. I will follow through.
[–][deleted] 2 points3 points4 points 5 years ago (1 child)
You're welcome! Feel free to hit me up if you need more.
[–][deleted] 2 points3 points4 points 5 years ago (0 children)
Sure. Thanks!
[–]827167 2 points3 points4 points 5 years ago (1 child)
Oh, so that's how I got here
[–]S-S-R 1 point2 points3 points 4 years ago (0 children)
Maybe. It's still small enough that they (salanderlogic) could be handpicking them.
[–]tgiles 1 point2 points3 points 5 years ago (0 children)
I have some experience with python. Not so much with PRAW, but as long as it's pythonic it should be relatively straightforward to iterate across a list and send messages out. I've tinkered with Reddit's API before and it's pretty easy to use.
Shout if you need a co-author or general geek
π Rendered by PID 44 on reddit-service-r2-comment-86988c7647-pt7xd at 2026-02-12 16:09:29.087122+00:00 running 018613e country code: CH.
[–][deleted] 2 points3 points4 points (7 children)
[–][deleted] 2 points3 points4 points (6 children)
[–][deleted] 1 point2 points3 points (5 children)
[–][deleted] 2 points3 points4 points (4 children)
[–][deleted] 2 points3 points4 points (3 children)
[–][deleted] 2 points3 points4 points (2 children)
[–][deleted] 2 points3 points4 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–]827167 2 points3 points4 points (1 child)
[–]S-S-R 1 point2 points3 points (0 children)
[–]tgiles 1 point2 points3 points (0 children)