Saturday, 8 April 2017

How to implement autocomplete search movie name in telegram bot

  • I am using NODEJS at backend to fetch movie data from IMDB NPM api.Following is my server.js code.

    server.js

    var token ="token"; var telegramBot= require('node-telegram-bot-api'); var bot= new telegramBot(token,{polling:true}); var express= require('express'); var imdb = require('imdb-api');

    var app =express();

    app.listen(8080,function(){ console.log("listening on 8080") })

    bot.onText(/Moviename/, function(msg, match) { data = msg.text; imdb.get(msg.text, function(err, movieList){ console.log(movieList); bot.sendMessage(msg.chat.id,movieList); //how i send data to bot when I type on keyboard

    }); });



via Harishchandra chincholkar

No comments:

Post a Comment