Attempted fix at embed not showing

merge-requests/1/merge
Bsian 2019-11-02 00:02:16 +00:00
parent a5cf30652c
commit 7c6d9e23cf
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
1 changed files with 3 additions and 2 deletions

View File

@ -21,7 +21,8 @@ export default class CWG_Data extends Command {
if (!args[0]) return this.client.commands.get('help').run(message, ['cwg', this.name]); if (!args[0]) return this.client.commands.get('help').run(message, ['cwg', this.name]);
const dom = await this.client.db.Domain.find({ $or: [{ domain: args[0] }, { port: Number(args[0]) || '' }] }); const dom = await this.client.db.Domain.find({ $or: [{ domain: args[0] }, { port: Number(args[0]) || '' }] });
if (!dom.length) return message.channel.createMessage(`***${this.client.stores.emojis.error} The domain or port you provided could not be found.***`); if (!dom.length) return message.channel.createMessage(`***${this.client.stores.emojis.error} The domain or port you provided could not be found.***`);
const embeds = dom.map(async (domain) => { const embeds: RichEmbed[] = [];
dom.forEach(async (domain) => {
const embed = new RichEmbed(); const embed = new RichEmbed();
embed.setTitle('Domain Information'); embed.setTitle('Domain Information');
embed.addField('Account Username', domain.account.username, true); embed.addField('Account Username', domain.account.username, true);
@ -33,7 +34,7 @@ export default class CWG_Data extends Command {
embed.addField('Certificate Expiration Date', moment(x509.parseCert(await fs.readFile(domain.x509.cert, { encoding: 'utf8' })).notAfter).format('dddd, MMMM Do YYYY, h:mm:ss A'), true); embed.addField('Certificate Expiration Date', moment(x509.parseCert(await fs.readFile(domain.x509.cert, { encoding: 'utf8' })).notAfter).format('dddd, MMMM Do YYYY, h:mm:ss A'), true);
embed.setFooter(this.client.user.username, this.client.user.avatarURL); embed.setFooter(this.client.user.username, this.client.user.avatarURL);
embed.setTimestamp(); embed.setTimestamp();
return embed; return embeds.push(embed);
}); });
// @ts-ignore // @ts-ignore
if (embeds.length === 1) return message.channel.createMessage({ embed: embeds[0] }); if (embeds.length === 1) return message.channel.createMessage({ embed: embeds[0] });