How to use the hubot.User 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 lmarkus / hubot-conversation / test / unit / index.js View on Github external
/**
 * Created by lmarkus on 9/30/15.
 */
/*eslint max-nested-callbacks:[0]*/
'use strict';
require('coffee-script/register');

var hubot = require('hubot'),
    Robot = hubot.Robot,
    Message = hubot.TextMessage,
    utils = require('../utils'),
    assert = require('chai').assert,
    Conversation = require('../../'),
    c = require('../../lib/constants'),
    Dialog = require('../../lib/Dialog'),
    testUser = new hubot.User('Lenny', {room: 'The Lounge'})
    ;

describe('#Hubot Conversation', function () {
    var bot, switchBoard, messenger, messages;

    beforeEach(function () {
        //reset the bot;
        bot = new Robot('hubot/src/adapters', 'shell');
        switchBoard = new Conversation(bot);
        messages = [
            new Message(testUser, 'hubot clean the house', '123'),
            new Message(testUser, 'the kitchen', '456'),
            new Message(testUser, 'yes', '789')
        ];
        messenger = new utils.Messenger(bot, messages);
    });
github shipengqi / sactive-bot / lib / adapters / wechat / wechat_client.js View on Github external
_notifyHubot(from, content, groupUser, MsgId) {
    let user = new User(from, {groupUser});
    if (this.ignoreGroupMessage && this._isGroup(from)) {
      return this.robot.logger.debug(`Ignore group message ${content}`);
    }
    this.robot.receive(new TextMessage(user, content, MsgId));
  }