UNPKG

imubot

Version:
87 lines (65 loc) 3.13 kB
(function() { var Adapter, EventEmitter, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty, slice = [].slice; EventEmitter = require('events').EventEmitter; Adapter = (function(superClass) { extend(Adapter, superClass); function Adapter(bot) { this.bot = bot; } Adapter.prototype.send = function() { var envelope, strings; envelope = arguments[0], strings = 2 <= arguments.length ? slice.call(arguments, 1) : []; }; Adapter.prototype.emote = function() { var envelope, strings; envelope = arguments[0], strings = 2 <= arguments.length ? slice.call(arguments, 1) : []; return this.send.apply(this, [envelope].concat(slice.call(strings))); }; Adapter.prototype.reply = function() { var envelope, strings; envelope = arguments[0], strings = 2 <= arguments.length ? slice.call(arguments, 1) : []; }; Adapter.prototype.topic = function() { var envelope, strings; envelope = arguments[0], strings = 2 <= arguments.length ? slice.call(arguments, 1) : []; }; Adapter.prototype.play = function() { var envelope, strings; envelope = arguments[0], strings = 2 <= arguments.length ? slice.call(arguments, 1) : []; }; Adapter.prototype.run = function() {}; Adapter.prototype.close = function() {}; Adapter.prototype.receive = function(message) { return this.bot.receive(message); }; Adapter.prototype.users = function() { this.bot.logger.warning('@users() is going to be deprecated in 3.0.0 use @bot.brain.users()'); return this.bot.brain.users(); }; Adapter.prototype.userForId = function(id, options) { this.bot.logger.warning('@userForId() is going to be deprecated in 3.0.0 use @bot.brain.userForId()'); return this.bot.brain.userForId(id, options); }; Adapter.prototype.userForName = function(name) { this.bot.logger.warning('@userForName() is going to be deprecated in 3.0.0 use @bot.brain.userForName()'); return this.bot.brain.userForName(name); }; Adapter.prototype.usersForRawFuzzyName = function(fuzzyName) { this.bot.logger.warning('@userForRawFuzzyName() is going to be deprecated in 3.0.0 use @bot.brain.userForRawFuzzyName()'); return this.bot.brain.usersForRawFuzzyName(fuzzyName); }; Adapter.prototype.usersForFuzzyName = function(fuzzyName) { this.bot.logger.warning('@userForFuzzyName() is going to be deprecated in 3.0.0 use @bot.brain.userForFuzzyName()'); return this.bot.brain.usersForFuzzyName(fuzzyName); }; Adapter.prototype.http = function(url) { this.bot.logger.warning('@http() is going to be deprecated in 3.0.0 use @bot.http()'); return this.bot.http(url); }; return Adapter; })(EventEmitter); module.exports = Adapter; }).call(this);