Skip to content
This repository has been archived by the owner on Jan 19, 2020. It is now read-only.

Getting Started : Creating Your First Bot sample does not work #87

Open
sarvex opened this issue Oct 24, 2017 · 4 comments
Open

Getting Started : Creating Your First Bot sample does not work #87

sarvex opened this issue Oct 24, 2017 · 4 comments

Comments

@sarvex
Copy link

sarvex commented Oct 24, 2017

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

@ummahusla
Copy link
Contributor

@sarvex Do you want to make a PR and update outdated information?

@sarvex
Copy link
Author

sarvex commented Oct 26, 2017

I would love to do that, unfortunately I cannot find the repository which hosts the samples

@lisawilliams
Copy link

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.

@StefH
Copy link

StefH commented Jan 16, 2018

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()

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

4 participants