change tech full name

pull/15/head
Matthew 2023-03-09 18:36:49 -05:00
parent 87753431f8
commit d7567ccb5a
1 changed files with 2 additions and 2 deletions

View File

@ -313,11 +313,11 @@ export default class Util {
public async getTechnicianFullName(tech: User) {
if (!tech) throw new Error('\'tech\' is undefined.');
if (tech.id === this.client.user.id) return 'SYSTEM';
const req = await axios.get('https://loc.sh/int/directory');
const find = req.data.find((mem) => mem.userID === tech.id);
if (tech.id === this.client.user.id) return 'SYSTEM';
return `${tech.username}, ${find.pn.join(', ')} (<@${tech.id}>)`;
return `${tech.username}${find.isManager ? '[k]' : ''}${find.title ? ` (${find.title} / ${find.dept})` : ` (${find.dept})`} <<@${tech.id}>>`;
}
public parseCertificate(pem: string) {