Last active
November 26, 2019 18:24
-
-
Save ronaldb/bc10a5ac7bf382cfb809f4c52fb57923 to your computer and use it in GitHub Desktop.
Simple plug bot in nodejs with Docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "simple-plug-bot", | |
"main": "server.js", | |
"dependencies": { | |
"plugapi": "^4.2.3" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!"); | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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