GithubHelp home page GithubHelp logo

dreamteammobile / botbuilder-viber Goto Github PK

View Code? Open in Web Editor NEW
14.0 4.0 5.0 6 KB

Plug-in Viber connector for Microsoft BotBuilder framework

JavaScript 100.00%
viber botbuilder-framework nodejs chat chatbot connector

botbuilder-viber's People

Contributors

alexsorokoletov avatar ebt-asorokoletov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

botbuilder-viber's Issues

[Question] Does this library partially support Hero Card?

On Kik, hero card is supported like this.
image 2017-10-29 12 45 00

So it is possible for this library to support hero card like this.
image 2017-10-29 12 45 04

The question is, do you guys have this feature? Cuz you guys only mentioned this, which isn't really detailed:

It can probably send whole set of different messages Viber supports (Text, Url, Contact, Picture, Video, Location, Sticker, File)

Can't reply to messages

Action: Send any message to the bot (The bot is supposed to reply to every message)

Result: No reply

2017-11-09T14:23:31.909639+00:00 app[web.1]: �[36m[2017-11-09 14:23:31.908] [DEBUG] �[39m�[36mValidating signature 'undefined' == '8e2424a0e9f276633233d569ac17b55efca8b8389f520d65eed4b6d16ae58978'�[39m

Might be Is actually a problem with viber-bot-node but they don't even have a issue section. I used restify for middleware though (Since botbuilder uses restify anyways).

Error ERR_INVALID_ARG_TYPE when sending message from Viber bot

Platform

Operating System: Ubuntu
Node Version: 9.3.0
NPM Version: 5.5.1

Code

https://github.com/DreamTeamMobile/botbuilder-viber
https://github.com/expressjs/express
https://github.com/expressjs/body-parser

var viber = require('botbuilder-viber');
var express = require('express');
var bodyParser = require('body-parser');

var viberOptions = {
  Token: '***',
  Name: '***',
  AvatarUrl: '***'
}
var viberChannel = new viber.ViberEnabledConnector(viberOptions);

var expressApp = express();

expressApp.listen(process.env.port || process.env.PORT || 3978, function() {
    console.log("Express server is running.");
});

expressApp.use(bodyParser.urlencoded({ extended: false }));

expressApp.use(bodyParser.json());

bot.connector(viber.ViberChannelId, viberChannel);

expressApp.use('/viber/webhook', viberChannel.listen());

Expected Behavior

No error

Actual Behavior

Error (repeats twice everytime) when I sending message from my viber bot.

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be one of type string, TypedArray, or DataView
at Hmac.update (internal/crypto/hash.js:53:11)
at MessageValidator._calculateHmacFromMessage (/app/node_modules/viber-bot/lib/message/message-validator.js:17:54)
at MessageValidator.validateMessage (/app/node_modules/viber-bot/lib/message/message-validator.js:11:30)
at _app.use (/app/node_modules/viber-bot/lib/middleware.js:61:32)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)
at /app/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
at next (/app/node_modules/express/lib/router/index.js:275:10)
at textParser (/app/node_modules/body-parser/lib/types/text.js:60:7)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)
at /app/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
at next (/app/node_modules/express/lib/router/index.js:275:10)
at expressInit (/app/node_modules/express/lib/middleware/init.js:40:5)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)
at /app/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
at next (/app/node_modules/express/lib/router/index.js:275:10)
at query (/app/node_modules/express/lib/middleware/query.js:45:5)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)
at /app/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
at next (/app/node_modules/express/lib/router/index.js:275:10)
at Function.handle (/app/node_modules/express/lib/router/index.js:174:3)

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be one of type string, TypedArray, or DataView
at Hmac.update (internal/crypto/hash.js:53:11)
at MessageValidator._calculateHmacFromMessage (/app/node_modules/viber-bot/lib/message/message-validator.js:17:54)
at MessageValidator.validateMessage (/app/node_modules/viber-bot/lib/message/message-validator.js:11:30)
at _app.use (/app/node_modules/viber-bot/lib/middleware.js:61:32)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)
at /app/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
at next (/app/node_modules/express/lib/router/index.js:275:10)
at textParser (/app/node_modules/body-parser/lib/types/text.js:60:7)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)
at /app/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
at next (/app/node_modules/express/lib/router/index.js:275:10)
at expressInit (/app/node_modules/express/lib/middleware/init.js:40:5)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)
at /app/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
at next (/app/node_modules/express/lib/router/index.js:275:10)
at query (/app/node_modules/express/lib/middleware/query.js:45:5)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/app/node_modules/express/lib/router/index.js:317:13)
at /app/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
at next (/app/node_modules/express/lib/router/index.js:275:10)
at Function.handle (/app/node_modules/express/lib/router/index.js:174:3)

How to register viberConnector on botframwork v4?

@alexsorokoletov @alexeystrakh
There seems to be drastic differences in the botframework v4 with V3. As I understand on V3 the viberConnector was registered with this line of code

//after initialising your bot and existing connectors
bot.connector(viber.ViberChannelId, viberChannel)

How would you achieve the same on V4?. Maybe use the botframework-connector package?

Webhook: Data must be a string error

Hi,

We are using the same example as in instructions and using express app. When registering webhook, we are getting this error. Any help would be appreciated.

TypeError: Data must be a string or a buffer
at TypeError (native)
at Hmac.Hash.update (crypto.js:74:16)
at MessageValidator._calculateHmacFromMessage (....\node_modules\viber-bot\lib\message\message-validator.js:17:54)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.