Bottr
Bottr copied to clipboard
Getting Started : Creating Your First Bot sample does not work
const Bottr = require('bottr');
const bot = new Bottr.Bot();
bot.on('message_received', function(message, session) {
session.send('Hello World')
})
bot.listen();
The code when run gives error Cannot GET /
However if I include the BottrApp back it gives the expected result
const Bottr = require('bottr');
const BottrApp = require('bottr-app');
const bot = new Bottr.Bot();
bot.use(new BottrApp());
bot.on('message_received', (message, session) => {
session.send('Hello, World');
});
bot.listen();
The guide should be updated with running code
@sarvex Do you want to make a PR and update outdated information?
I would love to do that, unfortunately I cannot find the repository which hosts the samples
I also had this problem, but when I restarted, it worked. I killed my terminal window, went back into the directory with my bottr bot, and typed bottr start
and went to localhost:3000. Then the bot worked.
Most recent text on page (https://bottr.co/docs/creating-your-first-bot.html) looks correct:
const Bottr = require('bottr')
const BottrApp = require('bottr-app')
const bot = new Bottr.Bot()
bot.use(new BottrApp())
bot.listen()