Giter Site home page Giter Site logo

bwz3rbot / approve_o_bot Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 759 KB

This Reddit Bot bot will continuously scan its inbox for mentions from the Master Subreddit. It will then add the user that mentioned it as a contributor on the Secondary Sub.

JavaScript 100.00%
reddit-bot reddit-bots snoowrap snoostorm api mod moderator-tools

approve_o_bot's Introduction

approve_o_bot

Table of Contents

About

This bot will continuously scan its inbox for mentions from the Master Subreddit. It will then add the user that mentioned it as a contributor on the Secondary Sub. You define these subreddit names in the pw.env file (along with your client credentials which you can find at (https://www.reddit.com/prefs/apps))

Getting Started

These instructions will get you a copy of the bot up and running on your local machine.

Prerequisites

Make sure you have the correct version of NodeJS for your system. You can find the download here(https://nodejs.org/en/download/)

You'll have to create a new account for your bot before you move any further.
And you'll have to grant the account permissions on both of the subs you are having it work on.
reddit.com/prefs/apps

Installing

Now that you've set up your bot account, granted it permissions on both subreddits, and created a script app, it's time to download the source code and paste in your environment variables.

Download the .zip file containing the source code on this page. Unzip it and save it to your computer somewhere. Now open up the pw.envEXAMPLE file.
Also have open reddit.com/prefs/apps as you'll need to copy/paste the items you'll find there. User agent is just a name that the server will identify your bot by. It can be whatever you want.

The MASTER_SUB will be the one you pin the post to. Have your users call the bot by its name /u/(whatever you named the account).

When they call the bot by its username it will receive a mention in its inbox and will respond.
If users are allowed to post in your sub, and when they call this bot from it -be it from the pinned post or otherwise- the bot will grant them contributor rights on your defined SECONDARY_SUB.
These names are case sensitive! So if your sub has a capital in it, and your pw.env file doesn't match, it will not work.

USER_AGENT=''
CLIENT_ID=''
CLIENT_SECRET=''
REDDIT_USER=''
REDDIT_PASS=''
MASTER_SUB=''
SECONDARY_SUB=''

now remove the EXAMPLE from the end of the filename.

pw.envEXAMPLE = pw.env

Now go back to your terminal and cd into the folder. Run this command to install the dependencies required to run a reddit bot in JavaScript.

npm install

Give it a minute to finish installing the dependencies. . . Then:

node src/app.js

Usage

Just keep a terminal open with it running.

As long as your internet is connected, it should continuously scan for mentions. If the bot is powered off and then restarted, it will scan the 5 most recent items in the inbox and then attempt to add the users who posted them as contributors to the secondary sub.

approve_o_bot's People

Contributors

bwz3rbot avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

 avatar

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.