text changes

pull/15/head
Matthew 2022-02-03 15:10:55 -05:00
parent a9a70080cb
commit 374dd04e0a
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
2 changed files with 10 additions and 1 deletions

View File

@ -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<Certificate>('https://certapi.libraryofcode.org/parse', pem)
.then((response) => response.data);

View File

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