Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type Error: Cannot read property 'send' of undefined #39

Closed
skibop opened this issue Jul 30, 2021 · 7 comments
Closed

Type Error: Cannot read property 'send' of undefined #39

skibop opened this issue Jul 30, 2021 · 7 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@skibop
Copy link
Contributor

skibop commented Jul 30, 2021

Describe the bug
Type Error:
message.guild.members.cache.get(user).send(dmEmbed);
^

TypeError: Cannot read property 'send' of undefined
at \nuggies\src\classes\giveaways.js:109:43

To Reproduce
Simply just run a giveaway

Expected behavior
Supposed to run smoothly

Desktop
-Windows

  • Latest Version
  • Node Version - v16.4.0

Additional context
Was working fine a day ago, then I think after a new update in giveaways, a bug happened

@skibop skibop added the bug Something isn't working label Jul 30, 2021
@Assassin-1234
Copy link
Member

hey there! sorry for the delay, I was sleeping

anyways, I cannot reproduce the bug, can you please tell me what version of nuggies npm you are using?
image
image

the winner returns undefined i.e either there are no winners or one of the winners left the server. I'd make sure to fix this in the next update but I need more information on how to reproduce this bug, were there any participants in the giveaway?

@skibop
Copy link
Contributor Author

skibop commented Jul 31, 2021

I am using the latest version of nuggies, I uninstalled, and reinstalled the package. It seems that when I restart the bot when there are giveaways running, the error comes up. I am able to host giveaways clearly, smoothly, and everything works fine. On restart of the bot however, the error comes up, and im not sure why, and how.

@Assassin-1234
Copy link
Member

I see where the problem is from, a document seems bugged in your database, It chooses a winner from the array but however the user doesnt exists in the guild so it returns the error. You can either search for { ended: false } in your giveaways collection and delete the document (or all) or wait for the next update of the package. Also please join the support server so I can give you the bug hunter role https://discord.gg/X8v22CPwFN

@Assassin-1234
Copy link
Member

let me know if you need anything else

@skibop
Copy link
Contributor Author

skibop commented Jul 31, 2021

Oh ok, I will let you know if I experience any other problems.

@Assassin-1234 Assassin-1234 added help wanted Extra attention is needed good first issue Good for newcomers labels Jul 31, 2021
@Assassin-1234
Copy link
Member

can I close this?

@skibop
Copy link
Contributor Author

skibop commented Aug 1, 2021

You may close this

@skibop skibop closed this as completed Aug 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants