const { Telegraf } = require ( 'telegraf' ) ; const token = process . env . BOT_TOKEN ; if ( token === undefined ) { throw new Error ( 'BOT_TOKEN must be provided!' ) ; } const bot = new Telegraf ( token ) ; bot . command ( 'image' , ( ctx ) => ctx . replyWithPhoto ( { url : 'https://picsum.photos/200/300/?random' } ) ) ; bot . on ( 'text' , ( ctx ) => ctx . replyWithHTML ( '<b>Hello</b>' ) ) ; bot . launch ( { webhook : { domain : 'https://---.localtunnel.me' , port : 3000 } } ) ; process . once ( 'SIGINT' , ( ) => bot . stop ( 'SIGINT' ) ) ; process . once ( 'SIGTERM' , ( ) => bot . stop ( 'SIGTERM' ) ) ;