Skip to content

21x37/comment-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

comment-bot

npm license

npm module to easily setup a reddit comment bot!

Install

npm install comment-bot

Usage

Create an app on reddit, and use the unique keys in creds.

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('🐈');
  };
});

About

easily setup a reddit bot that comments! 🤖

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published