comment-bot

1.0.1 • Public • Published

comment-bot

npm license

npm module to easily setup a reddit comment bot!

Install

npm install comment-bot

Usage

const commentBot = require('comment-bot');
 
const creds = {
    userAgent: process.env.USER_AGENT,
    clientId: process.env.CLIENT_ID,
    clientSecret: process.env.CLIENT_SECRET,
    username: process.env.REDDIT_USER,
    password: process.env.REDDIT_PASS
};
const bot = new commentBot(creds);

streamComment method is setup as so.

// streamComment(options, callback);
 
bot.streamComment(undefined, (comment) => {
  console.log(comment);
});

Commenting

const options = {
    subreddit: 'all',
    results: 25
};
 
const bot = new commentBot(creds);
 
bot.streamComments(options, (comments) => {
  if (comment.body.includes('meow') {
    comment.reply('🐈');
  };
});
 
 
 

Package Sidebar

Install

npm i comment-bot

Weekly Downloads

6

Version

1.0.1

License

MIT

Unpacked Size

2.11 kB

Total Files

3

Last publish

Collaborators

  • 21x37