1
0
Fork 0
refactor/models
Bsian 2019-11-02 00:41:15 +00:00
parent c7e036062f
commit 41914db777
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
1 changed files with 4 additions and 4 deletions

View File

@ -21,9 +21,9 @@ 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: RichEmbed[] = []; const embeds: RichEmbed[] = [];
const embeds = await dom.map(async (domain) => { dom.map(async (domain) => {
const cert = await fs.readFile(domain.x509.cert, { encoding: 'utf8' }); const cert = await fs.readFile(domain.x509.cert, { encoding: 'utf8' }).then((a) => a);
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);
@ -36,7 +36,7 @@ export default class CWG_Data extends Command {
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; // s.push(embed); return embed; // s.push(embed);
}); }).forEach(async (e) => embeds.push(await e));
this.client.signale.log(embeds); this.client.signale.log(embeds);
// @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] });