How to Build a Telegram Chat Bot with Meteor

A simple example of a chat bot code created with MeteorJS is described in How to Build a Chat Bot with Meteor. There is also a link to a GitHub repo with an open-source code.

4 Likes

Hi there! I’m trying to simulate this chat bot for Telegram. I’ve read the post from Simyon Vertugin, installed the required packages:

meteor npm install telegram-bot-api --save
meteor npm install cheerio --save
meteor add http

…and copied the files stored in Github.
I’ve also created a new bot in Telegram, in which process I’ve been given the following token:

Use this token to access the HTTP API:
280985203:AAGLQtOvAR-PTVRcayZXUqeCBxLjMn6HluQ

Then I replaced ‘TELEGRAM TOKEN’ in the vuiko_app.js file code:

//Creates telegram bot object
        this.bot = new TelegramBot({
            token: 'TELEGRAM TOKEN',
            updates: {
                enabled: true
            }
        });

…for the token I’ve been given from Telegram:

//Creates telegram bot object
        this.bot = new TelegramBot({
            token: 280985203:AAGLQtOvAR-PTVRcayZXUqeCBxLjMn6HluQ
            updates: {
                enabled: true
            }
        });

But when I run the app I get the following error message in the Command Prompt:

=> Error prevented startup:

While building for os.windows.x86_32:
server/vuiko_app.js:20:28: Unexpected token, expected , (20:28)

While processing files with ecmascript (for target os.windows.x86_32):
server/vuiko_app.js:20:28: Unexpected token, expected , (20:28)

=> Your application has errors. Waiting for file change.

I’m running the app locally (http://localhost:3000/).

Do I need to host my app in a web server to make it work? Or is it something (or everything) else I’m doing wrong?
I’m a very beginner in Meteor and all the programming world. If I’m doing stupid errors please apologize. Thanks in advance for your help!!

i think token must be string, try
token: “280985203:AAGLQtOvAR-PTVRcayZXUqeCBxLjMn6HluQ”