Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bwz3rbot/RedditMentionBot-Temlate
This is a template for a Reddit bot in JavaScript. It uses Snoowrap with two requesters, one to create a messaging queue, and another to process the mentions.
https://github.com/bwz3rbot/RedditMentionBot-Temlate
api bot javascript reddit snoostorm snoowrap template wrapper
Last synced: 3 months ago
JSON representation
This is a template for a Reddit bot in JavaScript. It uses Snoowrap with two requesters, one to create a messaging queue, and another to process the mentions.
- Host: GitHub
- URL: https://github.com/bwz3rbot/RedditMentionBot-Temlate
- Owner: bwz3rbot
- License: mit
- Created: 2020-08-30T21:09:33.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-03T17:10:34.000Z (about 4 years ago)
- Last Synced: 2024-07-28T13:12:50.327Z (3 months ago)
- Topics: api, bot, javascript, reddit, snoostorm, snoowrap, template, wrapper
- Language: JavaScript
- Homepage:
- Size: 30.3 KB
- Stars: 6
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Reddit MentionBot-Template
Snoowrap mention messaging queue## Table of Contents
- [About](#about)
- [Getting Started](#getting_started)
- [Usage](#usage)This is a template for a Reddit bot in JavaScript. It uses Snoowrap with two requesters, one to create a messaging queue, and another to process the mentions. If you've tried using Snoosorm to generate a stream from your inbox before, you may have run into a problem, where there is a need to utilize multiple requesters to complete API transactions. Well the fix is a messaging queue! This bot template is a simplified version of the ever popular Snoostorm library. It contains a messaging queue function (that Snoostorm was lacking!) to get around the problem of requiring many requesters.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
### Prerequisites
This application runs on NodeJS. You must have NodeJS to run it.
### Installing
A step by step series of examples that tell you how to get a development env running.
Download the source code...
Run this command...
```
npm install
```Of course you will find these values at https://www.reddit.com/prefs/apps/
```
USER_AGENT=''
CLIENT_ID=''
CLIENT_SECRET=''
REDDIT_USER=''
REDDIT_PASS=''
```And begin coding your bot!
Open up the file: src/service/BotService.js
Write your functions in this file, put your code within doSomething().
doSomething() will be called each time a new mention is received.
It will be passed a pre-fetched comment object, from your inbox.
doSomething() must return a Promise Object. The resulting function doesn't actually do anything with it, but to complete the promise chain, it is required.