Skip to content
This repository was archived by the owner on Feb 8, 2020. It is now read-only.
This repository was archived by the owner on Feb 8, 2020. It is now read-only.

Help pls Viber int doesnt work  #207

@glare1062

Description

@glare1062

Overview

  • What project is this issue for?:
    @broid/viber
  • Is this a bug, security, feature request, or feedback:
    bug

Details

Feature Overview

Feature List/Objectives

  • [ ] Awesome things
  • [ ] Sick implantations

Steps to Reproduce

My code :

const BroidViber = require('@broid/viber');

const viber = new BroidViber({ 
 username: 'broidbotversiontwo',
  token: "481652418fe7d78b-39ed57933220ec5f-fa7d2849fc1080d3",
  webhookURL: "https://645bafa1.ngrok.io/",
  http: {
    host: "127.0.0.1",
    port: 5000
  }
});

viber.connect()
  .subscribe({
    next: data => console.log(JSON.stringify(data)),
    error: err => console.error(`Something went wrong: ${JSON.stringify(err,2,3)}`),
    complete: () => console.log('complete'),
  });

  1. Start application with settings
    server listening on ngrok port 5000
  2. Send message

Observed

my stack trace from cmd :

port 127.0.0.1:5000...","v":1}
TypeError: Data must be a string or a buffer
    at Hmac.update (crypto.js:99:16)
    at MessageValidator._calculateHmacFromMessage (D:\Testing\newvibertest\node_modules\@broid\viber\node_modules\viber-bot\lib\message\message-validator.js:17:54)
    at MessageValidator.validateMessage (D:\Testing\newvibertest\node_modules\@broid\viber\node_modules\viber-bot\lib\message\message-validator.js:11:30)
    at _app.use (D:\Testing\newvibertest\node_modules\@broid\viber\node_modules\viber-bot\lib\middleware.js:61:32)
    at Layer.handle [as handle_request] (D:\Testing\newvibertest\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (D:\Testing\newvibertest\node_modules\express\lib\router\index.js:317:13)
    at D:\Testing\newvibertest\node_modules\express\lib\router\index.js:284:7
    at Function.process_params (D:\Testing\newvibertest\node_modules\express\lib\router\index.js:335:12)
    at next (D:\Testing\newvibertest\node_modules\express\lib\router\index.js:275:10)
    at textParser (D:\Testing\newvibertest\node_modules\body-parser\lib\types\text.js:60:7)
    at Layer.handle [as handle_request] (D:\Testing\newvibertest\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (D:\Testing\newvibertest\node_modules\express\lib\router\index.js:317:13)
    at D:\Testing\newvibertest\node_modules\express\lib\router\index.js:284:7
    at Function.process_params (D:\Testing\newvibertest\node_modules\express\lib\router\index.js:335:12)
    at next (D:\Testing\newvibertest\node_modules\express\lib\router\index.js:275:10)
    at expressInit (D:\Testing\newvibertest\node_modules\express\lib\middleware\init.js:40:5)
{"pid":10832,"hostname":"Lord-Acedia","name":"adapter","level":50,"time":1530509685274,"status":1,"status_message":"Result[HttpRequest[POST / HTTP/1.1]@315256a8 > HttpResponse[HTTP/1.1 500 Internal Server Error]@60f707ff] null","v":1}
Something went wrong: {
   "status": 1,
   "status_message": "Result[HttpRequest[POST / HTTP/1.1]@315256a8 > HttpResponse[HTTP/1.1 500 Internal Server Error]@60f707ff] null"
}

Expected

to connect but it doesnt due to type error during connecting gives internal server error 500

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions