AnIdiotsGuide/discordjs-bot-guide

tracking-used-invites.md

GregoryGHarding opened this issue · 4 comments

this code returns errors for first two member joins, i guess its creating a baseline, but theres no error handling. example:

You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
unhandledRejection: TypeError: Cannot read property 'get' of undefined
You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
unhandledRejection: TypeError: Cannot read property 'invite' of undefined

I read this line on that page:

Rember, because of the way the ready event works, you need to wait a bit before running the fetchInvite method[...] During this time, member joins won't correctly register because the cache doesn't exist.

And I believe the reason it may not be getting member joins is because of the way the ready event works.

dosent matter how long bot has been online for, the first two invites return the above error

Closing this due to no activity since November 18th, 2018.

We will investigate the issue though.