Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
'use strict'
import { Adapter, Response, TextMessage, EnterMessage, LeaveMessage } from 'hubot'

const Adapter = require.main.require('hubot/src/adapter')
const Response = require.main.require('hubot/src/response')
const { TextMessage, EnterMessage, LeaveMessage } = require.main.require('hubot/src/message')
const { driver, api, methodCache, settings } = require('@rocket.chat/sdk')
import { driver, api, methodCache, settings } from '@rocket.chat/sdk'

/** Extend default response with custom adapter methods */
class RocketChatResponse extends Response {
Expand Down Expand Up @@ -183,4 +180,8 @@ class RocketChatBotAdapter extends Adapter {
}
}

exports.use = (robot) => new RocketChatBotAdapter(robot)
export default {
async use (robot) {
return new RocketChatBotAdapter(robot)
}
}
113 changes: 57 additions & 56 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,62 +1,63 @@
{
"name": "hubot-rocketchat",
"version": "2.0.0-development",
"files": [
"index.js"
],
"author": {
"name": "Rocket.Chat",
"url": "https://rocket.chat/"
},
"contributors": [
{
"name": "Sing Li",
"email": "sing.li@rocket.chat"
"name": "hubot-rocketchat",
"version": "2.1.0-development",
"type": "module",
"files": [
"index.js"
],
"author": {
"name": "Rocket.Chat",
"url": "https://rocket.chat/"
},
{
"name": "Gabriel Engel",
"email": "gabriel.engel@rocket.chat"
"contributors": [
{
"name": "Sing Li",
"email": "sing.li@rocket.chat"
},
{
"name": "Gabriel Engel",
"email": "gabriel.engel@rocket.chat"
},
{
"name": "Aaron Ogle",
"email": "aaron.ogle@rocket.chat"
},
{
"name": "Tim Kinnane",
"email": "tim.kinnane@rocket.chat"
}
],
"description": "Hubot Rocket.Chat Adapter",
"keywords": [
"hubot",
"adapter",
"rocketchat",
"rocket",
"chat"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/RocketChat/hubot-rocketchat.git"
},
{
"name": "Aaron Ogle",
"email": "aaron.ogle@rocket.chat"
"bugs": {
"url": "https://github.com/RocketChat/hubot-rocketchat/issues",
"email": "support@rocket.chat"
},
{
"name": "Tim Kinnane",
"email": "tim.kinnane@rocket.chat"
"main": "index.js",
"dependencies": {
"@rocket.chat/sdk": "^0.2.9-2",
"hubot": "11"
},
"peerDependencies": {
"hubot": "11"
},
"devDependencies": {
"base64-url": "^2.0.0",
"debug": "^2.6.9",
"fresh": "^0.5.2",
"mime": "^1.4.1",
"morgan": "^1.9.1",
"negotiator": "^0.6.1"
}
],
"description": "Hubot Rocket.Chat Adapter",
"keywords": [
"hubot",
"adapter",
"rocketchat",
"rocket",
"chat"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/RocketChat/hubot-rocketchat.git"
},
"bugs": {
"url": "https://github.com/RocketChat/hubot-rocketchat/issues",
"email": "support@rocket.chat"
},
"main": "index.js",
"dependencies": {
"@rocket.chat/sdk": "^0.2.1",
"hubot": "3"
},
"peerDependencies": {
"hubot": "3"
},
"devDependencies": {
"base64-url": "^2.0.0",
"debug": "^2.6.9",
"fresh": "^0.5.2",
"mime": "^1.4.1",
"morgan": "^1.9.1",
"negotiator": "^0.6.1"
}
}