Skip to content

Commit

Permalink
debug: verbosity
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffrey-zang committed Jul 26, 2024
1 parent 4f0c823 commit 836be1e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ client.on('ready', async () => {
defaultPrefix: process.env.COMMAND_PREFIX
});

console.log(`Logged in as ${client.user.tag}!`);

verificationQueueProcessor.startProcessing(client);
})

client.on('voiceStateUpdate', (oldMember, newMember) => {
WatchController.handleEvent(oldMember, newMember);
})
})

client.on('messageCreate', (message) => {
if(message.channel.id === process.env.VERIFICATION_CHANNEL_ID){
Expand All @@ -71,6 +73,8 @@ client.on('messageCreate', (message) => {
client.on('guildMemberAdd', async (member) => {

let userInfo

console.log(member.user.tag + " joined the server");

try {
userInfo = await UserController.getUserByDiscordID(member.id)
Expand All @@ -79,8 +83,10 @@ client.on('guildMemberAdd', async (member) => {
}

if (userInfo) {
console.log(`${member.user.tag} is linked to ${userInfo.email}`);
try {
member.setNickname(userInfo.firstName + " " + userInfo.lastName);
console.log(`${member.user.tag} nickname set to ${userInfo.firstName} ${userInfo.lastName}`);
} catch (e) {
console.log(e);
}
Expand Down
4 changes: 2 additions & 2 deletions src/services/verificationQueueProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ VerificationQueueProcessor.startProcessing = function(client) {
}
}
catch(e) {
console.error("Error while processing verification queue", e);
console.error("Error while processing verification queue.");
if(e.code === 10007) {
console.error("Member is no longer in server. Skipping.")
}
Expand All @@ -30,7 +30,7 @@ VerificationQueueProcessor.startProcessing = function(client) {
}
}
catch(e) {
console.error("Unable to fetch/update verification queue.", e);
console.error("Unable to fetch/update verification queue.");
}


Expand Down

0 comments on commit 836be1e

Please sign in to comment.