GithubHelp home page GithubHelp logo

gbionescu / reddit-moderator-bot Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 1.0 315 KB

A reddit bot that uses plugins

License: The Unlicense

Python 99.15% Dockerfile 0.15% Shell 0.70%
reddit reddit-bot reddit-bots plugin subreddit codecov bot

reddit-moderator-bot's Introduction

Build status

NOT UPDATED codecov

Reddit moderator bot

This project is a reddit bot that can monitor subreddits and trigger custom actions through plugins.

Actions supported by plugins are triggered when:

  • a post is submitted in a comment
  • a comment is submitted in a subreddit
  • at a given period of time

For reference, there are a multiple plugin examples in plugins/.

In order to start up the bot, a config file named 'reddit-bot.ini' needs to be created. Config file example:

# Set details about the bot owner - used for signing messages and
# forwarding messages received by the bot
[owner]
owner = i_am_the_bot_owner_and_this_is_an_invalid_username

[reddit]
user_agent = user agent to be used by the bot
praw_config_section = PRAW config section to use for authenticating the bot

[config]
master_subreddit = subreddit where debug logs are posted
# This should not be changed since all the plugins are in plugins/
plugin_folders = plugins

[postgresql]
# Set DB connection settings to psql
host = localhost
database = dbname
user = dbuser
password = dbpassword

# Add optional Discord webhook for each botlog() instance
[webhook_discord]
storage=https://discord.web.hook1
audit=https://discord.web.hook2

Then, make sure that you install all the prerequisites listed in requirements.txt.

Finally, you can run python3 moderator-bot.py to start the bot.

How it works

  1. When starting up, the bot will log in using the given credentials.

  2. On each subreddit where the bot is a moderator, it will create a wiki page named control_panel. If your subreddit is called test123, then the page will be found at https://www.reddit.com/r/test123/wiki/control_panel

  3. In the control panel you can enable/disable plugins and check the plugin status.

  4. To enable a plugin you need to add it to the [Enabled Plugins] section, by copying and pasting the plugin name. Each plugin name is found in the bottom side of the page and contains a short description, a link to its configuration page and the current status for the subreddit (Enabled or Disabled).

  5. Once you have copied the plugin name to the [Enabled Plugins] section, save the page and wait until the Current Status line is set to Enabled. This should take about 5 to 10 minutes.

  6. To configure the newly enabled plugin, open the page referenced by the plugin, in the control_panel page. If the page did not exist before, the bot will create it with the basic configuration.

reddit-moderator-bot's People

Contributors

gbionescu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

br337

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.