Skip to content

Instantly share code, notes, and snippets.

@ronaldb
Last active November 26, 2019 18:24
Show Gist options
  • Save ronaldb/bc10a5ac7bf382cfb809f4c52fb57923 to your computer and use it in GitHub Desktop.
Save ronaldb/bc10a5ac7bf382cfb809f4c52fb57923 to your computer and use it in GitHub Desktop.
Simple plug bot in nodejs with Docker
FROM node:8
WORKDIR /usr/src/app
COPY ./package.json /usr/src/app/
RUN npm install
COPY ./server.js /usr/src/app/
CMD node server.js
{
"name": "simple-plug-bot",
"main": "server.js",
"dependencies": {
"plugapi": "^4.2.3"
}
}
var PlugAPI = require('plugapi');
bot = new PlugAPI({
"email": "UserName",
"password": "HighlySecret"
});
bot.connect("room-name");
bot.on('roomJoin', function(room) {
console.log("Joined " + room);
bot.sendChat("Hello, world!");
})
A simple Plug bot in node with Docker.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment