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();