1.0.1 • Published 7 years ago

bot-interface-socket.io v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

bot-interface-socket.io

A socket interface for your bot (ibot)

Install

npm install --save bot-interface-socket.io

Usage

// server.js

const iSocketIO = require('bot-interface-socket.io')
const bot = require('./lib/your-ibot')

bot.configure({
    interface: iSocketIO
})

process.on('SIGINT', () => {
    bot.exit()
    process.exit()
});

bot.run()
// index.html

<script src="/socket.io/socket.io.js"></script>
<script>
  var socket = io('http://localhost:9911');
  socket.on('message', function (message) {
    console.log(data);
    socket.emit('data', 'hello');
  });
</script>

License

Under the MIT license. See LICENSE file for more details.

1.0.1

7 years ago

1.0.0

7 years ago