Closed jackkru69 closed 3 years ago
mogoose(^6.0.5) with telegraf-session-mongodb(^2.0.2), telegraf(^4.4.2) (node:12494) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'enter' of undefined
function setupMongoose(bot: Telegraf<BotContext>) { // Connect to the db mongoose .connect(MONGO_URL, { // DB gets huge, so setting up custom timeouts socketTimeoutMS: 10000, connectTimeoutMS: 50000, }) .then((client) => { bot.use( mongodbSession(client.connection.db, { sessionName: 'session', collectionName: 'sessions', }), ); }); }
mogoose(^6.0.5) with telegraf-session-mongodb(^2.0.2), telegraf(^4.4.2) (node:12494) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'enter' of undefined