gasolin / webbybot Goto Github PK
View Code? Open in Web Editor NEWchatterbot written in es6 (es2015), fork from hubot
chatterbot written in es6 (es2015), fork from hubot
I saw a note somewhere about "porting Hubot from coffeescript to es6". What are the motivations for doing so vs just building on top of Hubot as-is?
webpack treat all require as webpack's require, but in some cases we need node require to require plugins dynamically
We could add HTTPClient compatible API based on stable
https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
http://www.w3ctech.com/topic/854
https://davidwalsh.name/fetch
provide web interface to easy config the chatterbot
$ npm install hubot-calculator
$ npm run build
$ ./bin/webby.js
webby> webby calc 1+1
Expected result:
webby > 2
Actual result
webby > 0
The return result in hubot-calculator is correct (2), so there is something wrong in respond or middleware module.
deprecated https://github.com/technoweenie/node-scoped-http-client because its no longer maintained
https://www.npmjs.com/package/node-fetch (preferred)
or
to generate custom webbybot and javascript plugin
such as https://github.com/github/hubot/pull/1134/files
related to #54
there's some skipped tests in robot_test related to middleware and listener
broadcast webby.local
so user can type that in searchbar and connect to webby web dashboard.
we use babel-plugin-add-module-exports to smooth the porting effort to es6 modules, now all modules are es6 ready, we could start remove dependency of babel-plugin-add-module-exports
currently webbybot needs to modify the require('hubot')
statement from every hubot-adapters, its not that convenient.
We can use mockery or mock-require to proxy hubot require to webbybot, so every hubot requirement will be redirected to webbybot
refer to http://webpack.github.io/docs/configuration.html#output-librarytarget
reconfig webpack to expose webby as commonjs library
input webby time in london
and got debug log with error:
[Wed Apr 13 2016 13:58:51 GMT+0800 (CST)] DEBUG Executing listener callback for Message '${message}'
[Wed Apr 13 2016 13:58:51 GMT+0800 (CST)] ERROR TypeError: Cannot read property 'robot' of undefined
at http (/home/gasolin/webby-confbot/node_modules/webbybot/dist/src/response.js:224:18)
at getTimezoneInfo (/home/gasolin/webby-confbot/node_modules/hubot-timezone/src/timezone.coffee:37:3)
at sendLocalTime (/home/gasolin/webby-confbot/node_modules/hubot-timezone/src/timezone.coffee:77:5)
at convertTime (/home/gasolin/webby-confbot/node_modules/hubot-timezone/src/timezone.coffee:92:5)
at TextListener.callback (/home/gasolin/webby-confbot/node_modules/hubot-timezone/src/timezone.coffee:116:5)
at executeListener (/home/gasolin/webby-confbot/node_modules/webbybot/dist/src/listener.js:116:19)
at allDone (/home/gasolin/webby-confbot/node_modules/webbybot/dist/src/middleware.js:85:16)
at /home/gasolin/webby-confbot/node_modules/webbybot/node_modules/async/lib/async.js:380:13
at /home/gasolin/webby-confbot/node_modules/webbybot/node_modules/async/lib/async.js:52:16
at iterate (/home/gasolin/webby-confbot/node_modules/webbybot/node_modules/async/lib/async.js:260:24)
at Object.async.forEachOfSeries.async.eachOfSeries (/home/gasolin/webby-confbot/node_modules/webbybot/node_modules/async/lib/async.js:281:9)
at Object.async.inject.async.foldl.async.reduce (/home/gasolin/webby-confbot/node_modules/webbybot/node_modules/async/lib/async.js:374:15)
at /home/gasolin/webby-confbot/node_modules/webbybot/dist/src/middleware.js:91:22
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickCallback (node.js:349:13)
followup of #3.
We moved to es6 export, will replace require
with import
and remove add-module-exports
babel plugin
The enableHttpd flag default isn't being properly handed off to the loadBot function in the bin script
to 4.x
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.