Skip to content

dtreichler/AutoModerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This is a bot for reddit, meant to automate straightforward moderation tasks by automatically performing actions based on defined conditions. For a large description of why this bot was created and what it does, please see this post I made about it on reddit.

If you'd like to utilize this functionality without running your own instance, just add AutoModerator as a mod to any subreddits you'd like to use it in, and send a message to me (Deimorz on reddit) explaining the conditions you'd like set up.

Disclaimer

This code has been made public largely for the purpose of displaying exactly what AutoModerator does, and as an example for others working on reddit bots (moderation-related or otherwise). It may be difficult for others to get functional. Use at your own risk.

Requirements

Setup

Copy modbot.cfg.example to modbot.cfg and edit values to match your desired database and reddit account. You can have SQLAlchemy create the tables for you by importing models.py into a Python interpreter session and calling db.create_all().

Add the bot's account as a moderator to any subreddits you want it to check, then add those subreddits to the subreddits table and the desired conditions to conditions. (See below for examples of conditions)

I run it using a cronjob that checks through the list of subreddits every 5 minutes, but it would also be possible to run in an infinite loop, so that each subreddit is checked as often as possible.

Condition Examples

Remove submissions using common URL-shorteners

  • subject = submission
  • attribute = domain
  • value = (bit\.ly|goo\.gl|tinyurl\.com|t\.co|tiny\.cc)
  • action = remove

Approve self-posts by not-extremely-new users

  • subject = submission
  • attribute = domain
  • value = self\.subredditname
  • account_age = 3
  • combined_karma = 10
  • action = approve

Allow only submissions from reddit.com and self-posts (e.g. /r/bestof)

Condition #1

  • subject = submission
  • attribute = domain
  • value = (reddit\.com|self\.bestof)
  • action = approve

Condition #2

  • subject = submission
  • attribute = domain
  • value = (reddit\.com|self\.bestof)
  • inverse = true
  • action = remove

About

A bot for automating straightforward moderation tasks on reddit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages