From 374dd04e0a4141d0a90a2ecbf906ea75b1170a25 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Thu, 3 Feb 2022 15:10:55 -0500 Subject: [PATCH] text changes --- src/class/Util.ts | 9 +++++++++ src/commands/tier.ts | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/class/Util.ts b/src/class/Util.ts index d4e7ddb..5309f3a 100644 --- a/src/class/Util.ts +++ b/src/class/Util.ts @@ -311,6 +311,15 @@ export default class Util { return Promise.resolve(log); } + public async getTechnicianFullName(tech: User) { + if (!tech) throw new Error('\'tech\' is undefined.'); + + 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}>)`; + } + public parseCertificate(pem: string) { return axios.post('https://certapi.libraryofcode.org/parse', pem) .then((response) => response.data); diff --git a/src/commands/tier.ts b/src/commands/tier.ts index b9f99dc..068dd83 100644 --- a/src/commands/tier.ts +++ b/src/commands/tier.ts @@ -32,7 +32,7 @@ export default class Tier extends Command { embed.setTitle('Cloud Account | Tier Change'); embed.setColor('#0099ff'); embed.addField('User', `${account.username} | <@${account.userID}>`, true); - embed.addField('Technician', message.author.toString(), true); + embed.addField('Technician', await this.client.util.getTechnicianFullName(message.author), true); embed.addField('Old Tier -> New Tier', `${account.tier} -> ${args[1]}`, true); embed.setFooter(this.client.user.username, this.client.user.avatarURL()); embed.setTimestamp();