forked from engineering/cloudservices
fix attempt x3
parent
a2e9a87e69
commit
7337f77027
|
@ -316,11 +316,12 @@ export default class Util {
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getTechnicianName(tech: User, format: TechnicianNameFormatOpt = TechnicianNameFormatOpt.Full) {
|
public async getTechnicianName(tech: User, format: TechnicianNameFormatOpt = TechnicianNameFormatOpt.Full) {
|
||||||
if (!tech) return 'SYSTEM (U)';
|
if (!tech) return 'SYSTEM (UT)';
|
||||||
if (tech.id === this.client.user.id) return 'SYSTEM (S)';
|
if (tech.id === this.client.user.id) return 'SYSTEM (SELF)';
|
||||||
|
|
||||||
const req = await axios.get('https://loc.sh/int/directory');
|
const req = await axios.get('https://loc.sh/int/directory');
|
||||||
const find = req.data.find((mem) => mem.userID === tech.id);
|
const find = req.data.find((mem) => mem.userID === tech.id);
|
||||||
|
if (!find) return 'SYSTEM (UF)';
|
||||||
if (format === TechnicianNameFormatOpt.Full) {
|
if (format === TechnicianNameFormatOpt.Full) {
|
||||||
return `${tech.username}${find.isManager ? ' [k]' : ''}${find.title ? ` (${find.title} / ${find.dept})` : ` (${find.dept})`} <<@${tech.id}>>`;
|
return `${tech.username}${find.isManager ? ' [k]' : ''}${find.title ? ` (${find.title} / ${find.dept})` : ` (${find.dept})`} <<@${tech.id}>>`;
|
||||||
} else if (format === TechnicianNameFormatOpt.Partial) {
|
} else if (format === TechnicianNameFormatOpt.Partial) {
|
||||||
|
|
Loading…
Reference in New Issue