Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

untitled notebook

node v16.15.0
version: 2.0.0
endpointsharetweet
const {Telegraf} = require('telegraf'); const Koa = require('koa'); const koaBody = require('koa-body'); const bot = new Telegraf(process.env.BOT_TOKEN); bot.telegram.setWebhook('https://runkit.io/descartes100/kit/branches/master'); bot.on('text', ({reply}) => reply('The time here is ::'+ new Date())); const app = new Koa() app.use(koaBody()); app.use((ctx, next) => ctx.method === 'POST' || ctx.url === '/secret-path' ? bot.handleUpdate(ctx.request.body, ctx.response) : next() ); app.listen(3000);
Loading…

no comments

    sign in to comment