Skip to content

michaelwnelson/reddit-modqueue-discord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Reddit Modqueue Discord Bot

This bot will retrieve all items in the modqueue for a given subreddit and post them to the Discord of your choice. Configuration is done in three easy steps:

  1. Create a Discord webhook
  2. Create a Reddit app
  3. Create an app with Heroku

Discord webhook

Server Settings > Webhooks > Create Webhook

Name it, select the channel you want the reports to reside, and save the webhook URL for later.

Reddit app

Navigate to www.reddit.com/prefs/apps/ and click the button to create an app.

Store the client_id (the string below personal use script) and the secret into the client_id and client_secret for our setup with Heroku in a minute.

Heroku app

If you're not familiar with Heroku, I'll avoid command line instructions and have you use their website. In which case you'll need to fork this repository (Fork button at the top of this GitHub page). Otherwise, you can simply clone it and deploy this code to your Heroku app via the command line interface.

  • Sign up for a free Heroku account
  • From your Dashboard, Create a new app. Name it something unique!
  • You'll be navigatged to the Deploy page. In the Deployment method section, select the GitHub option and type reddit-modqueue-discord into the repo-name input, click the Search button, and click the Connect button for the repository
  • Select the Overview tab and in the Installed add-ons section select the Configure Add-ons link. In the Add-ons section search for Heroku Postgres and select the Hobby Dev — Free Plan and click Provision

Next, navigate to Settings and click the Reveal Config Vars button in the Config Vars section to add the following keys and their appropriate values from the previous setup steps with Discord and Reddit. You should have an existing variable named DATABASE_URL from provisioning the Heroku Postgres instance. In the input boxes below, enter the appropriate keys and values:

CLIENT_ID — from Reddit setup

CLIENT_SECRET — from Reddit setup

REFRESH_TOKEN — from Reddit setup

SUBREDDIT — your subreddit name, e.g. for www.reddit.com/r/pics enter pics

USER_AGENT — create your own descriptive name. The useragent should be unique, descriptive, contain your username on Reddit, and the version number of your application. It's used by Reddit to identify your program. Here is reddit's documentation on it: www.github.com/reddit-archive/reddit/wiki/API#rules

WEBHOOK — from Discord setup

SKIP_DISCORD — optional flag, useful a first-time run to populate the database and not spam Discord

Launch your worker

Finally, we're ready to launch the worker! Navigate to the Overview tab on your Heroku dashboard and under Dyno formation click the Configure Dynos link. On this page, click the Edit button (pencil) and toggle it to on.

Free Heroku Hours

As long as you add a credit card to your account (which won't be charged), you'll be able to run your hobby dyno for free indefinitely. According to the Free dyno hour pool:

Personal accounts are given a base of 550 free dyno hours each month. In addition to these base hours, accounts which verify with a credit card will receive an additional 450 hours added to the monthly free dyno quota. This means you can receive a total of 1000 free dyno hours per month, if you verify your account with a credit card.

Support Me

You can support me by buying me a beer 🍺!

About

Post modqueue items to your Discord using webhooks

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages