1
0
Fork 0

fix: notify embed Technician field

master
Hiroyuki 2021-09-12 21:44:31 -04:00
parent 502321ee2e
commit ec343d541c
No known key found for this signature in database
GPG Key ID: AF65958B7B7362E6
1 changed files with 1 additions and 2 deletions

View File

@ -29,8 +29,7 @@ export default class Notify extends Command {
embed.addField('User', `${account.username} | <@${account.userID}>`, true); embed.addField('User', `${account.username} | <@${account.userID}>`, true);
const req = await axios.get('https://loc.sh/int/directory'); const req = await axios.get('https://loc.sh/int/directory');
const technician = req.data.find((mem) => mem.userID === message.author.id); const technician = req.data.find((mem) => mem.userID === message.author.id);
const technicianAccount = await this.client.db.Account.findOne({ userID: message.author.id }); embed.addField('Technician', message.author.id === this.client.user.id ? 'SYSTEM' : `${message.author.username}, ${technician.pn.join(', ')} (<@${message.author.id}>)`, true);
embed.addField('Technician', message.author.id === this.client.user.id ? 'SYSTEM' : `${technicianAccount.username}, ${technician.pn.join(', ')} (<@${message.author.id}>)`, true);
const ch = this.client.channels.cache.get('580950455581147146') as TextChannel; const ch = this.client.channels.cache.get('580950455581147146') as TextChannel;
ch.send({ embeds: [embed] }); ch.send({ embeds: [embed] });
this.client.util.transport.sendMail({ this.client.util.transport.sendMail({