Click here to Skip to main content
15,391,859 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello, Please help. I've created a telegram bot using telegraf+node.js and I'm trying to use bot.use(session()) in my telegram bot but it either scratches it out bot.use(session()) or it returns an error.

What I have tried:

Whenever I use the following it crosses out the 'bot.use(Session())':

TypeScript
const {Telegraf,Scenes,Markup,session, Composer, Context} = require('telegraf');

Whenever I use the following, I get an error when I try to run my code:

TypeScript
const session= require('telegraf/session')


I get the following error:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './session' is not defined by "exports" in C:\Users\Simanye\TestUpdatebot\node_modules\telegraf\package.json
    code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'


Your response and assistance would be highly appreciated.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900