1
0
Fork 0

fix issue with emailcode

refactor/models
Matthew 2020-05-01 17:45:53 -04:00
parent 50a9d05f97
commit 961f0e6c74
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
1 changed files with 1 additions and 0 deletions

View File

@ -16,6 +16,7 @@ export default class EmailCode extends Command {
public async run(message: Message, args: string[]) { public async run(message: Message, args: string[]) {
try { try {
if (!args.length) return this.client.commands.get('help').run(message, [this.name]);
const code = randomBytes(5).toString('hex'); const code = randomBytes(5).toString('hex');
if (!this.client.util.isValidEmail(args[0])) return message.channel.createMessage(`${this.client.stores.emojis.error} ***Invalid email address supplied.***`); if (!this.client.util.isValidEmail(args[0])) return message.channel.createMessage(`${this.client.stores.emojis.error} ***Invalid email address supplied.***`);
this.client.util.transport.sendMail({ this.client.util.transport.sendMail({