Giter Site home page Giter Site logo

botkit-ssh's Introduction

SSH Botkit

An SSH Chat and Connector for Botkit

This is a SSH based chat server and botkit connector for testing bots in a chat-like environment.

The chat server is not a production-ready system. The goal here is to provide a simple chat-like interface to test your chatbot.

Installing

npm install --save botkit-ssh

botkit-ssh exports the start, chat, and listener.

start

The function start(config) starts a chat server and returns a bot controller that will receive events from the chat server.

The config.port parameter indicates the port that the chat server will listen on, it defaults to 51515.

The config.keyFilename should indicate the filename of the private host key for the ssh server, it defaults to './ssh/key'.

The following sample assumes that you have generated an ssh key in './ssh/key'.

const botkitSSH = require('botkit-ssh');

const controller = botkitSSH.start();
controller.spawn();

controller.hears('hello', 'message_received', function (bot, message) {
  bot.reply(message, 'Hello Yourself!');
});

Your chat username will be the ssh username, the password is 'password'.

chat and listener

Internally, start is starting a chat-server and an ssh-bot listening to it.

function start(config) {
  const _config = config || {};
  const _port = _config.port || 51515;
  const _keyFilename = _config.keyFilename || './ssh/key';

  const controller = listener(chat.chatBus);
  chat.server(_keyFilename).listen(_port, function () {
    console.log('Listening on port ' + this.address().port);
  });
  return controller;
}

Chat Commands

Quit

/q
/quit
/exit

Change Channels

New channels will automatically be created

/ch {channel name}

Direct Message Channels

DMs are treated like channels, accessed via the /dm command.

/dm {recipient}

botkit-ssh's People

Contributors

kstafford3 avatar

Stargazers

c0met_ avatar TY avatar Ben Brown avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.