fancy-groupme-bot

Use the Groupme bot API

Fancy Groupme Bot

Groupme Bot API wrapper.

npm install fancy-groupme-bot

This bot connects to a room and repeats whatever was said.

var bot = require('fancy-groupme-bot');
var util = require('util');
 
// local configuration read from env.
const TOKEN = process.env['TOKEN']; // your groupme api token
const GROUP = process.env['GROUP']; // the room you want to join
const NAME = process.env['NAME']; // the name of your bot
const URL = process.env['URL']; // the domain you're serving from, should be accessible by Groupme.
const CONFIG = {token:TOKEN, group:GROUP, name:NAME, url:URL};
 
var mybot = bot(CONFIG);
 
mybot.on('botRegistered', function(b) {
  console.log("I am registered");
  b.message("WHAT UP BRO?");
});
 
mybot.on('botMessage', function(b, message) {
  console.log("I got a message, fyi");
  if (message.name != b.name) {
    b.message(message.name + " said " + message.text);
  }
});
 
console.log("i am serving");
mybot.serve(8000);