Skip to content

Commit

Permalink
=)
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaUrsa committed Feb 20, 2024
1 parent d29f201 commit fcf1993
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/discord/utils/trust.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ but they were already marked at trusted in the database, so no message was sent`

if (guildData.channel_trust) {
const auditLog = await discordClient.channels.fetch(guildData.channel_trust) as TextChannel;
await auditLog.send(stripIndents`. **${newMember.displayName} i sent the welcome message to lounge!*`);
await auditLog.send(stripIndents`. I sent **${newMember.displayName}'s welcome message to lounge!`);
}
} else {
await db.members.upsert({
Expand Down Expand Up @@ -316,19 +316,18 @@ export default async function trust(

if (trustScoreData.trustScore > guildData.trust_score_limit) {
// What happens when the user has a high trust score

// Remove the unverified role, add the verified role
await member.roles.add(env.ROLE_VERIFIED);
await member.roles.remove(env.ROLE_UNVERIFIED);

if (guildData.channel_trust) {
const auditLog = await discordClient.channels.fetch(guildData.channel_trust) as TextChannel;
await auditLog.send(stripIndents`. ${member.displayName} is above the set trust score of \
${guildData.trust_score_limit}, I removed the Unverified role and added Verified*`);
await auditLog.send(stripIndents`${member.displayName} is above the set trust score of \
${guildData.trust_score_limit}, I removed the Unverified role and added Verified`);

// /events/guildMemberUpdate will recognize that the verified rol has been added
// and will then activate addedVerified() above
}

// Remove the unverified role, add the verified role
await member.roles.add(env.ROLE_VERIFIED);
await member.roles.remove(env.ROLE_UNVERIFIED);
}

if (bannedGuilds.length > 0) {
Expand Down

0 comments on commit fcf1993

Please sign in to comment.