Skip to content
This repository has been archived by the owner on Aug 12, 2023. It is now read-only.

Lazy will not store responses #9

Open
andrewtheone opened this issue Sep 30, 2017 · 1 comment
Open

Lazy will not store responses #9

andrewtheone opened this issue Sep 30, 2017 · 1 comment

Comments

@andrewtheone
Copy link

if(text.indexOf('T:') === 0) {
	var a = text.split('T:');
	var b = a[1].split('|');
	lazy.learn({phrase: b[0], category: b[1]});
	chat.say("I've learned - "+b[0]+" > "+b[1]);
} else if(text.indexOf('F:') === 0 ){
	var a = text.split('F:');
	var b = a[1].split('|');
	lazy.forget({phrase: b[0], category: b[1]});
	chat.say("I've forgot- "+b[0]+" > "+b[1]);
} else {
	lazy.query({phrase: text}).then(function(r) {
		console.log(r);
		chat.say(r.response);
	});
	
}

I teach lazy simple grettings but when i greet lazy it will return r.response undefined, but the r.details has the category "greeting". I traced it back and i found out it somehow will not store phrases.

Any idea?

@cagataycali
Copy link
Owner

Did you add response for category?
await lazy.addResponse({category: 'greetings', response: 'Hi there!'})

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

No branches or pull requests

2 participants