MemberUtil.ts formatting changes

pull/1/head
Matthew 2024-10-24 20:40:37 -04:00
parent 4dddc4c316
commit 2dc23b5298
Signed by: matthew
SSH Key Fingerprint: SHA256:piIXekA9q1p0ZGi4ogFbNY1embip5Ytbi3v8AZ8UYq4
2 changed files with 32 additions and 6 deletions

View File

@ -15,6 +15,34 @@ export type MemberAdditionalAcknowledgement =
"Voting Seat Member of the Board of Governors" |
string;
export const MemberGuildRoleIDMap = {
// Chair/Vice Chair of the Board of Governors
CHAIR_OR_VICE_OF_BOARD: "608394038466445320",
// Management
MANAGEMENT: "1077646568091570236",
// Director of Operations
DIRECTOR_OF_OPERATIONS: "1077647072163020840",
// Director of Engineering
DIRECTOR_OF_ENGINEERING: "1077646956890951690",
// Board of Governors
BOARD_OF_GOVERNORS: "662163685439045632",
// Project Manager
PROJECT_MANAGER: "1077647157928132711",
// Services Manager
SERVICES_MANAGER: "1077647467056742482",
// Staff
STAFF: "446104438969466890",
// Technician
TECHNICIAN: "701454780828221450",
// Moderator
MODERATOR: "455972169449734144",
// Core Team
CORE_TEAM: "453689940140883988",
// Intern (Training)
INTERN: "701481967149121627",
}
// enum for the used programming languages in whois information
export enum MemberUsedLanguages {
ASM = "lang-asm",

View File

@ -61,25 +61,23 @@ export default class MemberUtil {
// TODO: comments and extended formatting
public static formatName(target: GuildMember | User, partner?: Partner | null): FormatNameOptions {
console.log(`[MemberUtil] Formatting name for ${target.displayName} at url ${target instanceof GuildMember ? target.user.displayAvatarURL() : target.displayAvatarURL()}`);
// if the role type is managerial, add a [k] to the end of the name
// if the partner exists, set the iconURL to the organizational logo
if (partner?.roleType == PartnerRoleType.MANAGERIAL) {
console.log(`[MemberUtil] Formatting name for ${target.displayName}`)
return {
text: `${target.displayName} [k]`,
iconURL: "https://static.libraryofcode.org/library_of_code_redeg.png"
iconURL: target.displayAvatarURL(),
}
} else if (partner?.commissionType == PartnerCommissionType.CONTRACTUAL) { // if the commission type is contractual, add a [c] to the end of the name
console.log(`[MemberUtil] Formatting name for ${target.displayName}`)
return {
text: `${target.displayName} [c]`,
iconURL: "https://static.libraryofcode.org/library_of_code_redeg.png"
iconURL: target instanceof GuildMember ? target.user.displayAvatarURL() : target.displayAvatarURL(),
}
} else { // otherwise, just set the author to the member's display name
console.log(`[MemberUtil] Formatting name for ${target.displayName} at url ${target instanceof GuildMember ? target.user.displayAvatarURL() : target.displayAvatarURL()}`);
return {
text: target.displayName,
iconURL: target instanceof GuildMember ? target.user.displayAvatarURL() : target.displayAvatarURL()
iconURL: target instanceof GuildMember ? target.user.displayAvatarURL() : target.displayAvatarURL(),
}
}
}