bot.on('inviteDelete', async (invite) =>
{
console.log(invite);
inviteData = await inviteModel.findOne({code: invite.code});
if(inviteData.uses == 0 || inviteData.uses == null)
{
await inviteModel.deleteMany({ code: invite.code });
}
else
await inviteModel.findOneAndUpdate({code: invite.code}, {$set: {active: false}});
});```
Whenever an invite gets deleted, I am trying to archive them within my database if they were ever used (because I'm a data whore).
But for some reason most of the invite's data is ``null`` even though I tested an invite **and used it** before deleting...?
Is this just how it is, or am I doing something wrong?
#Deleting Invites don't hold any invite data?
6 messages · Page 1 of 1 (latest)
• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.
The invite is deleted and Discord sends only its channelId, guildId and code
you can fetch that info through the audit log