Skip to content

Commit e9eeb88

Browse files
authored
fix: correct reply and comments in updated roles sample (discordjs#372)
1 parent a8e8e3a commit e9eeb88

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

guide/popular-topics/common-questions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ Assuming the process is to be done for the guild the message is sent in.
352352
// If the role(s) are present on the old member object but no longer on the new one (i.e role(s) were removed)
353353
const removedRoles = oldMember.roles.filter(role => !newMember.roles.has(role.id));
354354
if(removedRoles.size > 0) console.log(`The roles ${removedRoles.map(r => r.name)} were removed from ${oldMember.displayName}.`);
355-
// If the role(s) are present on the new member object but are not on the new one (i.e role(s) were added)
355+
// If the role(s) are present on the new member object but are not on the old one (i.e role(s) were added)
356356
const addedRoles = newMember.roles.filter(role => !oldMember.roles.has(role.id));
357357
if(addedRoles.size > 0) console.log(`The roles ${addedRoles.map(r => r.name)} were added to ${oldMember.displayName}.`);
358358
});
@@ -369,11 +369,11 @@ Assuming the process is to be done for the guild the message is sent in.
369369
<client>.on('guildMemberUpdate', (oldMember, newMember) => {
370370
// If the role(s) are present on the old member object but no longer on the new one (i.e role(s) were removed)
371371
const removedRoles = oldMember.roles.cache.filter(role => !newMember.roles.cache.has(role.id));
372-
if (removedRoles.size > 0) console.log(`The roles ${removedRoles.map(r => r.name)} were added to ${oldMember.displayName}.`);
373-
// If the role(s) are present on the new member object but are not on the new one (i.e role(s) were added)
372+
if (removedRoles.size > 0) console.log(`The roles ${removedRoles.map(r => r.name)} were removed from ${oldMember.displayName}.`);
373+
// If the role(s) are present on the new member object but are not on the old one (i.e role(s) were added)
374374
const addedRoles = newMember.roles.cache.filter(role => !oldMember.roles.cache.has(role.id));
375-
if (addedRoles.size > 0) console.log(`The roles ${addedRoles.map(r => r.name)} were removed from ${oldMember.displayName}.`);
375+
if (addedRoles.size > 0) console.log(`The roles ${addedRoles.map(r => r.name)} were added to ${oldMember.displayName}.`);
376376
});
377377
```
378378

379-
</branch>
379+
</branch>

0 commit comments

Comments
 (0)