Would you like to clone this notebook?

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


untitled notebook

node v16.18.0
version: 2.0.0
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);

no comments

    sign in to comment