Note: these directions come without much conversation, let the hacking begin! Set up a Bot with @BotFather Create a package.json { : , : , : , : , : { : }, : { : , : , : , : , : }, : } "name" "tg-bot-now" "version" "0.2.0" "description" "A sample Telegram bot via now.js" "main" "app.js" "scripts" "start" "node app.js" "dependencies" "axios" "" "body-parser" "" "express" "*" "request" "^2.88.0" "requests" "^0.3.0" "license" "MIT" Create a now.json { : , : [ { : , : } ], : [ { : , : } ] } "version" 2 "builds" "src" "app.js" "use" "@now/node-server" "routes" "src" "/(.*)" "dest" "app.js" Create an app.js express = ( ); app = express(); request = ( ); bodyParser = ( ); axios = ( ); app.use(bodyParser.json()); app.use( bodyParser.urlencoded({ : }) ); .log( ); { axios.post(url, { : message.chat.id, : reply }).then( { .log( ); res.end( ); }).catch( { .log(error); }); } app.get( , { res.send( ); }) bots = [ , ] app.post( , { .log( ); { message } = req.body; reply = ; (message.text != ) { (message.text.toLowerCase().indexOf( ) != ) { reply = ( b bots) { r = request.get(bots[b], { j = .parse(d) start = j.btc[ ][ ] btc = j.btc[j.btc.length - ][ ] end = j.btc[j.btc.length - ][ ] diff = end - start s = diff / m = s / h = m / d = h / y = d / apr = (j.btc[j.btc.length - ][ ] - j.btc[ ][ ]) / y reply += r.request.uri.href.substring( , r.request.uri.href.length - ) + reply += + (start) + reply += + (end) + reply += + j.qty + reply += + j.pos + reply += + btc.toPrecision( ) + reply += + (apr / ).toPrecision( ) + reply += + (apr).toPrecision( ) + }) } setTimeout( { sendMessage(telegram_url, message, reply, res); }, ); } { res.end( ); } } }); telegram_url = + process.env.key + ; app.listen( , () => .log( )); var require "express" var var require 'request' var require "body-parser" const require "axios" extended true console "run" ( ) function sendMessage url, message, reply, res chat_id text => response console "Message posted" "ok" => error console '/' ( ) function req, res 'hello' var "http://patbot1.duckdns.org/update" "http://coindexbot.duckdns.org:8080/update" "/startbot" ( ) function req, res console "startbot" const let "Welcome to Jare's bot bot" if undefined if "statusupdate" -1 "" for var in ( ) function e, r, d JSON 0 0 1 1 1 0 var 1000 var 60 var 60 var 24 var 365 var 1 1 0 1 0 7 '\n' "Start: " new Date '\n' "Now: " new Date "\n" "BTC Notional traded recent memory: " "\n" "Current position: " "\n" "BTC % Delta: " 4 '%\n' "BTC % ROI / day projected: " 365 4 '%\n' "BTC % APR projected: " 4 '%\n\n' ( ) function 2000 else "ok" let "https://api.telegram.org/bot" "/sendMessage" 8000 console "Telegram bot is listening on port 8000!" Note: it’s important to send a in every case, or else your bot will get hung up on old messages it couldn’t process and no was sent – putting it in a forever loop of never sending a response! res.end res.end 1. set your env key = export key "whateverbotfathergaveyou" 2. install i npm 3. install now npm -g now i 4. run now now 5. output Register your POST callback wtih Telegram’s grandmasters curl -F //api.telegram /botYOUR_TELEGRAM_API_TOKEN/setWebhook "url=https://URL_FROM_NOW/startbot" https: .org Congrats! Join Us on Telegram !! Click here to subscribe: http://eepurl.com/gIykNL Be notified about new articles? Welcome to the Jarett Dunn email subscriber list! Each new signup will receive a link to download the Coindex Labs non-NDA teaser, which includes information about the value proposition for my organization – where we’re setting our sights first on a money-printing machine, then returning later as conquering heroes in order to then defeat the world’s greater humanitarian issues. Remember to CLICK, subscribe: http://eepurl.com/gIykNL !! ( : ) Disclaimer The Author is the Chief Liquidity Officer at Coindex See this article in it’s original form on dunncreativess.github.io! Try this bot on Telegram! ! https://t.me/JareBotBot ! Sponsor my opensource efforts on GitHub