5hurn
5hurn
DIAdiscord.js - Imagine an app
Created by 5hurn on 6/9/2024 in #djs-questions
help with invite tracker needed
hey, i'm not that experienced with coding discord bots and i need help with an invite tracker. right now i have a /invites command that tells the user how many invites they have. it works fine but i want the invites to only track members that are in the server. so if a member that they have invited leaves the server, their invites go down. i'm not even show how i'd go about creating that, just looking for some direction on how i'd do something like this. here's how invites are currently tracked:
const invites = await guild.invites.fetch();
const userInvites = invites.filter(invite => invite.inviter && invite.inviter.id === user.id);
let inviteCount = 0;
userInvites.forEach(invite => {
inviteCount += invite.uses;
});
const invites = await guild.invites.fetch();
const userInvites = invites.filter(invite => invite.inviter && invite.inviter.id === user.id);
let inviteCount = 0;
userInvites.forEach(invite => {
inviteCount += invite.uses;
});
5 replies
DIAdiscord.js - Imagine an app
Created by 5hurn on 1/12/2023 in #djs-questions
ticket system breaking because of reactions overloading
hey, does anyone know how to fix this? when I overload my bot my spamming reactions it'll slow everything down and when I close the ticket it errors because it's still tryna check for the channel or messages that don't exist. I also can't use buttons and have to use reactions for my ticket system. Code & Error: https://hastebin.com/getihuwaji.javascript
3 replies