Androz2091 / discord-giveaways

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

Cannot read property 'members' of null #349

Closed waki285 closed 3 years ago

waki285 commented 3 years ago

Describe the bug

I'm having this repository error:

       if (new Discord.Intents(this.client.options.intents).has('GUILD_MEMBERS')) await guild.members.fetch();
                                                                                               ^

TypeError: Cannot read property 'members' of null
    at Giveaway.roll (/home/runner/AuroraBot-Dev/node_modules/discord-giveaways/src/Giveaway.js:411:96)
    at /home/runner/AuroraBot-Dev/node_modules/discord-giveaways/src/Giveaway.js:517:40

To Reproduce

  1. start giveaway
  2. wait to end the giveaway
  3. bot restart

Additional context

Nico105 commented 3 years ago

you really are on .0.1? I thought they had fixed this... 😑, will report. I will add || channel.guild since they mentioned that should work. Thanks for letting know.

Nico105 commented 3 years ago

Nah moment. With 0.1 they already added || channel.guild themselves. Hmmm...

Nico105 commented 3 years ago

@waki285 I mean you didn't start the gaw in a DM channel, did you?

Nico105 commented 3 years ago

Also, was this a 1 time occurrence? Or did this happen for multiple giveaways?

waki285 commented 3 years ago

Giveaway starts with the guild's text channel. Also, I'm not using end orreroll and I can hold Giveaway normally until I reboot.

waki285 commented 3 years ago

Additional bug, Restarting the bot will reroll the Giveaway that should have ended.

Nico105 commented 3 years ago

Additional bug, Restarting the bot will reroll the Giveaway that should have ended.

so there were winners before the restart, but after the restart it rolled again?

waki285 commented 3 years ago

Additional bug, Restarting the bot will reroll the Giveaway that should have ended.

so there were winners before the restart, but after the restart it rolled again? Yes. There was a winner, but it rerolls when I restart.

waki285 commented 3 years ago

hmmmm... I'm very bitter about the bug that giveaway resets when I reboot.

Nico105 commented 3 years ago

hmmmm... I'm very bitter about the bug that giveaway resets when I reboot.

are you sure that you followed the example for the custom db correctly? since its a known issue that replit resets local storage dbs (json) but if you have configured the extended class properly it should normally be fine

waki285 commented 3 years ago

hmmmm... I'm very bitter about the bug that giveaway resets when I reboot.

are you sure that you followed the example for the custom db correctly? since its a known issue that replit resets local storage dbs (json) but if you have configured the extended class properly it should normally be fine

I'm using @replit/database database

Nico105 commented 3 years ago

hmmmm... I'm very bitter about the bug that giveaway resets when I reboot.

are you sure that you followed the example for the custom db correctly? since its a known issue that replit resets local storage dbs (json) but if you have configured the extended class properly it should normally be fine

I'm using @replit/database database

so you 100% do not see a "giveaways.json" file in your project right?

waki285 commented 3 years ago

hmmmm... I'm very bitter about the bug that giveaway resets when I reboot.

are you sure that you followed the example for the custom db correctly? since its a known issue that replit resets local storage dbs (json) but if you have configured the extended class properly it should normally be fine

I'm using @replit/database database

so you 100% do not see a "giveaways.json" file in your project right?

Yes, I don't see a "giveaways.json".

Nico105 commented 3 years ago

And so the gaw resets happen every restart?

Just for confirmation, could you update the branch to the latest commit and check if it still happens.

Androz2091 commented 3 years ago

Closed due to inactivity