-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsnakeroom-role-info.js
60 lines (51 loc) · 1.92 KB
/
snakeroom-role-info.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
'use strict';
// TODO: This is very stubbed out. Snakeroom role stuff will be here. Probably the snakeroom-specific audit methods, too.
/*/
const sneklingAuditStep = (member) => {
let auditResult = defaultPassResult;
if (!isBot(member) && !hasRole(member, sneklingRoleID)) {
auditResult = makeAuditResult({
stepPassed: false,
reason: `Every non-bot in Snakeroom should be a snekling.`,
rolesToAdd: [rolesMap.get(sneklingRoleID)]
});
} else if (isBot(member) && hasRole(member, sneklingRoleID)) {
auditResult = makeAuditResult({
stepPassed: false,
reason: `${member.displayName} is a bot, and Sneklings are people only.`,
rolesToRemove: [rolesMap.get(sneklingRoleID)]
});
}
return auditResult;
};
const trustedDeveloperAuditStep = (member) => {
let auditResult = defaultPassResult;
if (hasRole(member, developerRoleID) && hasRole(member, trustedRoleID)) {
auditResult = makeAuditResult({
stepPassed: false,
reason: `${member.displayName} is Trusted and a Developer. They should simply be a Trusted Developer.`,
rolesToRemove: [rolesMap.get(trustedRoleID), rolesMap.get(developerRoleID)],
rolesToAdd: [rolesMap.get(trustedDeveloperRoleID)]
});
} else if (hasRole(member, trustedDeveloperRoleID)) {
if (hasRole(member, trustedRoleID)) {
auditResult = makeAuditResult({
stepPassed: false,
reason: `${member.displayName} is a Trusted Developer. The Trusted role is redundant.`,
rolesToRemove: [rolesMap.get(trustedRoleID)]
});
} else if (hasRole(member, developerRoleID)) {
auditResult = makeAuditResult({
stepPassed: false,
reason: `${member.displayName} is a Trusted Developer. The Developer role is redundant.`,
rolesToRemove: [rolesMap.get(developerRoleID)]
});
}
}
return auditResult;
};
const shouldBeOGSnek = (member) => {
return isBot(member)
&& member.joinedAt < ogSnekCutoffDate;
};
//*/