Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with method "getToken" #6

Open
aminespinoza opened this issue Apr 18, 2018 · 2 comments
Open

Problem with method "getToken" #6

aminespinoza opened this issue Apr 18, 2018 · 2 comments

Comments

@aminespinoza
Copy link

When I try to create a token by using method getToken like this:

var botclient = require('directline-api');
var secret = 'mi secret key';
var token = client.getToken(secret);

botclient.createConversation(token);

I get the following:
/home/taller/Documentos/ClonedRepos/BotFalabellaJs/testingscripts/botdirect.js:3
var token = botclient.getToken(secret);
^

TypeError: botclient.getToken is not a function
at Object. (/home/taller/Documentos/ClonedRepos/BotFalabellaJs/testingscripts/botdirect.js:3:23)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
at startup (internal/bootstrap/node.js:201:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)

Am I creating something wrong or is really an issue?

@aminespinoza
Copy link
Author

As a matter of fact, I got the same problem in the test file:

directline-api@1.1.2 test /home/taller/Documentos/ClonedRepos/BotFalabellaJs/node_modules/directline-api
ava

1 failed

  1. DirectLineAPI#dialog
    failed with "directLineAPI.getToken is not a function"
    Test.fn (test.js:173:19)
    Array.map ()
    process._tickCallback (internal/process/next_tick.js:178:19)
    npm ERR! Test failed. See above for more details.

@hailiang-wang
Copy link
Owner

Looks wired.
What version of nodejs are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants