fletcherist / yandex-dialogs-sdk

☂️Build your skill for Yandex.Alice with ease. (nodejs/typescript)
MIT License
122 stars 16 forks source link

Scene.any (no such command) #109

Closed Teoreez closed 4 years ago

Teoreez commented 6 years ago

Description:

Scene.any does not catch phrases.

Version: 2.0.6

Full code:

const { Alice, Reply, Scene, Markup } = require('yandex-dialogs-sdk');
const alice = new Alice();

const TEST_ROOM = 'TEST_ROOM';

const TestRoom = new Scene(TEST_ROOM);
const M = Markup;

alice.command('', ctx => {
    ctx.enter(TEST_ROOM);
    return Reply.text('Начать тест');
});

TestRoom.any( ctx => {
    console.log(ctx.message);
    return Reply.text('Произвести действие!');
});

const port = 3001
alice.listen(port, '/', callback => console.log(port))

Console log:

PS Q:\Apps\Adventure\Adventure Engine\Adventure-Engine---YandexAlice-MongoDB-JS> node testany.js (node:10540) UnhandledPromiseRejectionWarning: Error: No response for request "123". Try add command for it or add default command. at Alice.handleRequest (Q:\Apps\Adventure\Adventure Engine\Adventure-Engine---YandexAlice-MongoDB-JS\node_modules\yandex-dialogs-sdk\dist\alice.js:63:19) at process._tickCallback (internal/process/next_tick.js:68:7) (node:10540) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:10540) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

fletcherist commented 4 years ago

this bug was fixed in the latest release