change tech full name
parent
87753431f8
commit
d7567ccb5a
|
@ -313,11 +313,11 @@ export default class Util {
|
||||||
|
|
||||||
public async getTechnicianFullName(tech: User) {
|
public async getTechnicianFullName(tech: User) {
|
||||||
if (!tech) throw new Error('\'tech\' is undefined.');
|
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 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 (tech.id === this.client.user.id) return 'SYSTEM';
|
return `${tech.username}${find.isManager ? '[k]' : ''}${find.title ? ` (${find.title} / ${find.dept})` : ` (${find.dept})`} <<@${tech.id}>>`;
|
||||||
return `${tech.username}, ${find.pn.join(', ')} (<@${tech.id}>)`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public parseCertificate(pem: string) {
|
public parseCertificate(pem: string) {
|
||||||
|
|
Loading…
Reference in New Issue