Comments (3)
Found a quick solution, with a new problem.
I put everything on the client side.
bot.on('reply', function(result) {
Logs.insert({
message: result,
date: Date(),
type: "bot"
});
});
bot.send(newCommand);
It was fine the first reply.
Hi
Greetings. What's your name?
Then the problem occurred starting at 2nd reply.
I'm William
Nice to meet you William!
Nice to meet you William!
3rd reply
Hello
Hi. What's your name?
Hi. What's your name?
Hi. What's your name?
Each subsequent replies were duplicated, more and more....
Any tips?
from botml.
Solved it with a little console.log hacking...
Still looking for a better solution.
var baseLogFunction = console.log;
console.log = function(){
baseLogFunction.apply(console, arguments);
var args = Array.prototype.slice.call(arguments);
Session.set('botReply', args);
}
bot.send(newCommand);
Logs.insert({
message: Session.get('botReply').join().replace('INFO: [botml] < ', ''),
date: Date(),
type: "bot",
});
from botml.
A little better version (without console.log hacking):
bot.on('reply', function(result) {
Session.set('botReply', result);
});
bot.send(newCommand);
Logs.insert({
message: Session.get('botReply'),
date: Date(),
type: "bot"
});
from botml.
Related Issues (13)
- Events get triggered only when the conversation is over HOT 1
- could you add also bower.json HOT 1
- Ability to load script manually HOT 2
- Load other .bot files HOT 2
- Start bot from checkpoint or previous point HOT 2
- design questions HOT 4
- how to instance for multiple conversations? HOT 4
- conditional logic problems HOT 8
- how does 'return' work from conditionals? HOT 5
- Does this support length wildcard??? HOT 1
- Lack of Documentation HOT 4
- licensing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from botml.