How to use the hubot.loadBot function in hubot

To help you get started, we’ve selected a few hubot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github saraford / atom-hubot / lib / hubot.js View on Github external
toggle() {
    console.log('Hubot was toggled again!');
    var isVisible = this.modalPanel.isVisible();

    if (isVisible) {
      this.modalPanel.hide();

    } else {
      this.modalPanel.show();

      try {

          robot = Hubot.loadBot(undefined, "electron", false, "Hubot", false);

          var stream = fs.createWriteStream(__dirname + '/../logs/hubot.log');
          robot.logger = new Log('debug', stream);

          robot.adapter.wireUpResponses(updateWindowWithHubotMessage);
          user = robot.brain.userForId(1, 'atom', 'Shell');
          console.log('hubot loaded');

          // wire up the buttons
          hubotOutputWindow = $('#hubot-output');
          scriptsPathLink = $('#scripts-link');

          // setup the watcher on the play.coffee
          startWatchingUserScript();

          reloadAllScripts();
github saraford / train-your-hubot / renderer.js View on Github external
function startHubot() {
  // adapterPath, adapterName, enableHttpd, botName, botAlias
  // adapterPath - the first parameter it is never used, hence undefined
  //debugger
  robot = Hubot.loadBot(undefined, "electron", false, "Hubot", false);
  robot.adapter.once('connected', loadInitialScripts);
  robot.adapter.wireUpResponses(updateWindowWithHubotMessage);
  robot.run();

  updateWindowWithHubotMessage("I'm ready!");
}
github Bottr-js / Bottr / lib / hubot-bot.js View on Github external
hubot_botkit.defineBot(function(botkit, config) {

      var bot = {
          botkit: botkit,
          config: Object.assign({
            name: 'pozi',
            client: 'shell'
          }, config || {}),
          utterances: botkit.utterances,
      };

      var hubot = Hubot.loadBot(null, bot.config.client, true, bot.config.name, null)

      bot.startConversation = function(utterance, cb) {
          botkit.startConversation(this, utterance, cb);
      };

      bot.reply = function(utterance, response, cb) {

        utterance.send(response)

        if (cb) {
          cb()
        }
      };

      bot.findConversation = function(message, cb) {
          if (cb) {