How do I integrate wit.ai and hubot? - wit.ai

I want to integrate wit.ai with hubot. Besides that I have hubot running on a discourse forum server via an adapter. That is secondary.
I installed https://github.com/guillaumewuip/hubot-wit-helper, installed the npm package, but I get this error when I run bin/hubot
[wit] Stories and POST /converse have been deprecated. This will break in February 2018!
[Thu Mar 01 2018 01:44:58 GMT+0000 (UTC)] ERROR Unable to load /var/discourse/avebot/scripts/avebot: Error: The 'send' action is missing. Learn more at https://wit.ai/docs/quickstart
at validateActions (/var/discourse/avebot/node_modules/node-wit/lib/wit.js:223:11)
at validate (/var/discourse/avebot/node_modules/node-wit/lib/wit.js:212:20)
at new Wit (/var/discourse/avebot/node_modules/node-wit/lib/wit.js:20:35)
at new Robot (/var/discourse/avebot/node_modules/hubot-wit-helper/lib/Robot.js:24:24)
at bot (/var/discourse/avebot/scripts/avebot.js:28:26)
at Robot.loadFile (/var/discourse/avebot/node_modules/hubot/src/robot.coffee:358:11, <js>:226:13)
at Robot.load (/var/discourse/avebot/node_modules/hubot/src/robot.coffee:377:9, <js>:247:30)
at Discourse.loadScripts (/var/discourse/avebot/node_modules/hubot/bin/hubot:93:5, <js>:97:13)
at Object.onceWrapper (events.js:219:13)
at Discourse.emit (events.js:127:13)
at Discourse.run (/var/discourse/avebot/node_modules/hubot-discourse-adapter/src/discourse.coffee:63:5, <js>:89:12)
at Robot.run (/var/discourse/avebot/node_modules/hubot/src/robot.coffee:590:5, <js>:464:27)
at Object.<anonymous> (/var/discourse/avebot/node_modules/hubot/bin/hubot:168:8, <js>:182:11)
at Object.<anonymous> (/var/discourse/avebot/node_modules/hubot/bin/hubot:5:1, <js>:185:4)
at Module._compile (module.js:662:30)
at Object.exports.run (/var/discourse/avebot/node_modules/coffee-script/lib/coffee-script/coffee-script.js:103:25)
at compileScript (/var/discourse/avebot/node_modules/coffee-script/lib/coffee-script/command.js:171:29)
at /var/discourse/avebot/node_modules/coffee-script/lib/coffee-script/command.js:143:18
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:532:3)
I put the server token in the wit_token = 'mywittoken' part of the example script found on the github page above, which starts like this
'use strict';
(() => {
const witHelper = require('hubot-wit-helper');
const WIT_TOKEN = 'myWitToken';
How do I get it all to work? Is it too old to use?

Wit.ai discontinued stories and /converse as of February 13, 2018 10am PST
The hubot-wit-helper npm package appears to still use stories through wit.runActions() [hubot-wit-helper/lib/Robot.js line 72] which will no longer work as of the discontinuation of Wit stories.
To get wit.ai working again in this package you need to follow the official guide on how to migrate the codebase from stories to the /message API.

Related

Error while attempting to install vuetify's localization features after vuetify is initially installed

i am attempting to install vuetify's Internationalization (i18n) feature.
following the documentation provided by vuetify here https://vuetifyjs.com/en/features/internationalization/
i had already installed vuetify using the CLI approach, and have been customizing and using vuetify for a couple of days in this project before exploring this translation feature.
so im trying to install this feature after having installed vuetify, dont know if that is the cause of any issues or not.
so i attempted to run vue add vuetify -lang
which triggered this response
📦 Installing vue-cli-plugin-vuetify...
removed 22 packages, and audited 674 packages in 2s
83 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
✔ Successfully installed plugin: vue-cli-plugin-vuetify
🚀 Invoking generator for vue-cli-plugin-vuetify...
ERROR Error: Cannot find module '../presets/undefined'
Require stack:
- D:\Projects\DigitalCV\node_modules\vue-cli-plugin-vuetify\generator\index.js
- D:\Projects\DigitalCV\package.json
Error: Cannot find module '../presets/undefined'
Require stack:
- D:\Projects\DigitalCV\package.json
at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
at Module._load (node:internal/modules/cjs/loader:841:27)
at Module.require (node:internal/modules/cjs/loader:1061:19)
at require (node:internal/modules/cjs/helpers:103:18)
at module.exports (D:\Projects\DigitalCV\node_modules\vue-cli-plugin-vuetify\generator\index.js:15:10)
at Generator.initPlugins (C:\Users\spels47\AppData\Roaming\npm\node_modules\#vue\cli\lib\Generator.js:180:13)
at Generator.generate (C:\Users\spels47\AppData\Roaming\npm\node_modules\#vue\cli\lib\Generator.js:198:16)
at runGenerator (C:\Users\spels47\AppData\Roaming\npm\node_modules\#vue\cli\lib\invoke.js:111:19)
at async invoke (C:\Users\spels47\AppData\Roaming\npm\node_modules\#vue\cli\lib\invoke.js:92:3)
checking the file paths provided in the require stack section showed me the files were in fact there.
i decided to check inside the generator\index.js file
there i could see the part where '../presets/undefined' came from
module.exports = (api, opts) => {
const { fileExists } = require('../util/helpers')
const alaCarte = require('./tools/alaCarte')
const fonts = require('./tools/fonts')
const polyfill = require('./tools/polyfill')
const vite = require('./tools/vite')
const vuetify = require('./tools/vuetify')
const fs = require('fs')
if (opts.install !== 'configure') {
opts = {
hasTS: api.hasPlugin('typescript') || Object.keys(api.generator.pkg.devDependencies).includes('typescript'),
...opts,
...require(`../presets/${opts.install}`).plugins['vue-cli-plugin-vuetify'],
}
}
here we can see that undefined was supposed to be opts.install but its undefined for some reason.
i dont know why this installation process fails or how i can fix it, does anyone know or have any ideas as to what the issue could be here?
i tried to run vue add vuetify -lang and expected the installation to run its course without errors.
i tried looking in the file paths provided in the error and while i did find what the undefined value was supposed to be provided by the opts.install property. this information doesnt tell me anything i can use to further debug the error.
tried checking out similar stack overflow issues,
closest i found was this Unable to install vuetify
but in that case vuetify failed to install in the first place, my case is different because vuetify did install correctly but fails when trying to add the lang feature.

Shopify Slate won't build, zip or start?

Trying to get running with Shopify's Slate, it installs a new theme without errors but then we I navigate into the theme and try to run slate start or slate zip, I get this error:
.../node_modules/#shopify/theme-lint/index.js:12
module.exports.runAll = function(path, reporter = new Reporter()) {
^
SyntaxError: Unexpected token =
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
There is some more error code after that, but it looks like the error is when theme-link is trying to create a new reporter? Anyone else run into this?
Updating Node [and npm] should fix this problem.
Slate requires Node 6.x Slate Getting started

Using vue.js with Phoenix failed so far

I follow this tutorial to learn to use vue.js in a Phoenix web app.
So far I made until I should get the word Vuechat in browser, but I didn't. Instead I got error message in iex console like below:
05 May 13:19:52 - info: compiling
05 May 13:19:54 - error: Resolving deps of web\static\js\app.js failed. Could not load module 'my-app.vue' from 'c:\Users\sadmin\Documents\Elixir\vuechat\web\static\js'. Possible solution: add 'my-app.vue' to package.json and `npm install`.
I thought I did everything according to that tutorial, but still not getting it works. I don't know much about using brunch or npm too, so please help
Location of my-app.vue is shows in below image
P.S. I'm working under Windows 10 os and using Visual Studio Code
Thanks.

Appcelerator Studio undefined1 SyntaxError: Unexpected end of input

My Appcelerator Studio suddenly just crashed and can't open or use it anymore. I tried UNINSTALLING and REINSTALLING it, but with no luck.
Any thoughts about this? Please check the Crash error report here
System Information
OS: MAC(OS X El Capitan v10.11.3)
Memory: 4GB RAM
Crash report
undefined:1
SyntaxError: Unexpected end of input
at Object.parse (native)
at Object.readConfig (/usr/local/lib/node_modules/appcelerator/lib/util.js:720:30)
at Object.<anonymous> (/usr/local/lib/node_modules/appcelerator/bin/appc:96:23)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
at node.js:968:3
Looks like there is an incompatibility between your CLI version and Node version.
What's the node and CLI version which you are running now?
Node 4.2 and higher is required to run the latest Studio 4.8.0/CLI 6.0/SDK 6.0. Ideally, Studio Mac installer would have taken care of this but it didn't happen in your case.
To make it work in your case, follow the instructions from here for clean installation of Node and CLI, then run the studio.
https://medium.com/all-titanium/reinstalling-appcelerator-titanium-on-mac-from-scratch-9a2bb6b9b629#.d0k1wzt3z
I had a similar error with Appc 7.1.2 -- here's what I learned.
The specific error occurs at /usr/local/lib/node_modules/appcelerator/lib/util.js:720
For other Appcelerator versions, the line number within util.js may be different.
I opened util.js in an editor and added a line to figure out what's going on:
console.log(cf);
Now I could see which config file it was attempting to read, which in my case turned out to be:
~/.appcelerator/appc-cli.json
This .json file was empty. Upon deleting this file, the error went away.
Now run appc setup and enter your credentials and answer the other prompts, and that will re-create and re-write appc-cli.json.

Titanium ACS issue

trying to create an ACS server using Titanium Studio. Following the example of pixgrid (https://github.com/appcelerator/pixgrid/), but always get an error when trying to run locally; console output:
[INFO] Installing dependencies...
[INFO] Dependencies installed.
[INFO] socket.io started
[ERROR] Error occurred. TypeError: Cannot call method 'init' of undefined
at Object.start (/app.js:8:7)
app.js listing:
var ACS = require('acs').ACS,
logger = require('acs').logger,
express = require('express'),
partials = require('express-partials');
// initialize app (setup ACS library and logger)
function start(app) {
ACS.init('***', '***');
logger.setLevel('DEBUG');
//use connect.session
app.use(express.cookieParser());
app.use(express.session({ key: 'node.acs', secret: "secret" }));
//set favicon
app.use(express.favicon(__dirname + '/public/images/favicon.ico'));
//set to use express-partial for view
app.use(partials());
//Request body parsing middleware supporting JSON, urlencoded, and multipart
app.use(express.bodyParser());
}
// release resources
function stop() {
}
Ofcourse I have my OATH key and secret at the ***. Same when running from command line (acs run).
I am running Titanium Studio, build 3.4.1.201410281727.
I can however publish the service, and then run it from the cloud without any issues. For development this is not ideal, so want to run it locally (local node.ACS server).
I guess there must be something wrong with where things are installed (only used default), or permissions. Anyone that got a clue how to fix this? Have spent some hours now searching the internet, but seem to be the only one with this exact problem. No clue what else to try.
Thanks for reading this far. If you require more information to help me, let me know.
Ok, I found the problem. They changed the way to use ACS in the last upgrade.
Classic mode was:
var ACS = require('acs').ACS;
ACS.init('<ACS Key>', '<ACS secret');
Now they changed it and ACS is a "module", like any other one, so you must use the new way. In the package.json file add it as a dependecy:
"dependencies": {
"acs-node": ">=0.9.2"
}
Install it: npm install acs-node
Now you can use it in its new format, on the app.js file:
var ACS = require('acs-node');
ACS.init('<App Key>');
It's all explained here: http://docs.appcelerator.com/cloud/latest/#!/guide/node_acs