Skip to content

Commit

Permalink
oops i forgot this important change
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLlamamarketer committed Sep 19, 2023
1 parent e9e13d9 commit 3becce4
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions commands/test/inviteTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,27 @@ async function trackInvites() {
);

// Role assignment logic here based on inviteCount
const role: Role | undefined = guild.roles.cache.get('1153789870582550598');
const role1: Role | undefined = guild.roles.cache.get('1153789870582550598');
const role2: Role | undefined = guild.roles.cache.get('1153796740072349726');

if (inviteCount >= 2 && role) {
if (inviteCount == 2 && role1) {
const member = await guild.members.fetch(userId);
if (member) {
await member.roles.add(role).catch(console.error);
await member.roles.add(role1).catch(console.error);
} else {
console.error('Member not found');
}
}
else if (inviteCount > 2 && role2) {
const member = await guild.members.fetch(userId);
if (member) {
await member.roles.add(role2).catch(console.error);
} else {
console.error('Member not found');
}
}
}
}

const job = new cron.CronJob('0 * * * * *', trackInvites); // checks for invites every hour
const job = new cron.CronJob('0 * * * * *', trackInvites); // checks for invites every minute
job.start();

0 comments on commit 3becce4

Please sign in to comment.