Balboa is a Python based bot that enables reddit.com's subreddit administrators to define, manage, and automate the process of handling changes to a user's flair. Features include the automatic handling and construction of flair text and CSS changes, including the dynamic constructions of these values via regex and time-based restrictions.
Balboa was initially created for /r/survivor by /u/gariond on behalf of /u/aksurvivorfan. Special thanks to GitHub user gavin19 for his work on gavin19/reddit-flair-bot
, whose work this is bot is based upon.
- Ensure your system has all requisite packages installed
pip install -r requirements.txt
- Generate a
./.env
(or provide environmental variables)
Note: You can use
./env.template
as a guide. Various service integrations will require additiona configration
- Provide the following .env variables:
LOGGING
(boolean
): Determines if logging will be written out tolog.txt
REFRESH_INTERVAL
(int
, milliseconds): If you need to slow your bot down (i.e. if you're recieving errors related to reddit API rate limiting, )
- Create a reddit account that the bot will use to sign in
Note: This bot's reddit account must be given
wiki
andflair
moderation permissions on the subreddit you intend to have the bot manage.
- Register your bot on Reddit's Application Preferences management page. Obtain an
APP_ID
, andAPP_SECRET
- Click
create another app…
on the bottom of the page to begin the registration process
Note: You'll need to select a type of
script
from the radio options under the 'create application' prompt- The
about url
field should contain a link to a wiki page on your subreddit about the bot you've created - The
redirect uri
needs to be a valid url, it's suggested to use the url of your subreddit
Note: By registering an application you are agreeing to reddit's API Usage Guidelines
- Once you register successfully register your application, you'll see the
APP_ID
listed as a string below the text "personal use script", under the name you provided. Treat this information like you would a password! - To view your
APP_SECRET
, clickedit
in the bottom left corner of your registered application. Once expanded, the secret will be listed in the field labeledsecret
. Treat this information like you would a password! - You may elect to register your bot on your personal account, however if you choose to you must add your bot as an application developer. You can do this by adding the bot's username to the list of developers under
Developed Applications
> application name >edit
>add developer
- Click
- Provide the following .env variables:
APP_ID
(string
): Generated during the Reddit application registration processAPP_SECRET
(string
): Also generated during the Reddit application registration processUSERNAME
(string
): The reddit username of the account that will act as the botSUBREDDIT
(string
): The name of the subreddit where the bot will act
You can configure Balboa to manage the reciept, and assignemnt of flair to users on your subreddit.