constpath=require('path');const{ Bot }=require('@dlghq/dialog-node-client');constbot=newBot(// endpoints['wss://ws1.dlg.im'],// user credentials{phone: '75555555555',code: '5555'});bot.onMessage(async(update)=>{// get self uidconstuid=awaitbot.getUid();// check if message contents photoif(update.content.type==='photo'){// load photo urlconsturl=awaitbot.loadFileUrl(update.content.file);// and send it back to the clientawaitbot.sendTextMessage(update.peer,`Thanks for photo: ${url}`);// send file as imageawaitbot.sendPhotoMessage(update.peer,path.resolve(__dirname,'dinotocat.png'));}else{// send text messageawaitbot.sendTextMessage(update.peer,'Hello =)');}});// handle errorsbot.on('error',(error)=>{console.error(error);process.exit(1);});