Androz2091 / discord-giveaways

🎉 Complete framework to facilitate the creation of giveaways using discord.js
https://discord-giveaways.js.org
MIT License
334 stars 127 forks source link

TypeError: Cannot read property 'forEach' of null #175

Closed typhoon11 closed 3 years ago

typhoon11 commented 3 years ago

I changed my database from quick.db to quickmongo so I used your code. But now I am getting this error. image

Nico105 commented 3 years ago
db.once('ready', async () => {
    if ((await db.get('giveaways')) === null) await db.set('giveaways', []);
});

Are you sure that you have this? https://github.com/Androz2091/discord-giveaways/blob/master/examples/custom-databases/mongodb.js

typhoon11 commented 3 years ago

Yeah I have that. image

typhoon11 commented 3 years ago

I figured out the problem. db.once is not an option anymore so it will be db.on