diff --git a/src/class/Util.ts b/src/class/Util.ts index 1398782..185aaaa 100644 --- a/src/class/Util.ts +++ b/src/class/Util.ts @@ -117,7 +117,7 @@ export default class Util { public randomPassword(): string { let tempPass = ''; const passChars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0']; - tempPass += passChars[Math.floor(Math.random() * passChars.length)]; + while (tempPass.length < 5) { tempPass += passChars[Math.floor(Math.random() * passChars.length)]; } return tempPass; } diff --git a/src/commands/createaccount.ts b/src/commands/createaccount.ts index 6142ee2..174bbff 100644 --- a/src/commands/createaccount.ts +++ b/src/commands/createaccount.ts @@ -119,7 +119,7 @@ export default class CreateAccount extends Command { + 'You may now return to Modmail, and continue setting up your account from there.\n\n' + 'An email containing some useful information has also been sent').catch(); - return confirmation.edit(`${this.client.stores.emojis.success} ***Account successfully created***\n**Username:** \`${args[3]}\`\n**Temporary Password:** \`${tempPass}\``); + return confirmation.edit(`${this.client.stores.emojis.success} ***Account successfully created***\n**Username:** \`${args[2]}\`\n**Temporary Password:** \`${tempPass}\``); } catch (error) { return this.client.util.handleError(error, message, this); } diff --git a/src/commands/deleteaccount.ts b/src/commands/deleteaccount.ts index ed65f87..c987e64 100644 --- a/src/commands/deleteaccount.ts +++ b/src/commands/deleteaccount.ts @@ -35,11 +35,11 @@ export default class DeleteAccount extends Command { } const deleting = await message.channel.createMessage(`${this.client.stores.emojis.loading} ***Deleteing account, please wait...***`); - await this.client.util.deleteAccount(username); const reason = args.slice(1).join(' '); const logInput = { username, userID, logID: uuid(), moderatorID: message.author.id, type: 4, date: new Date(), reason: null }; if (reason) logInput.reason = reason; await this.client.util.createModerationLog(args[0], message.member, 4, reason); + await this.client.util.deleteAccount(username); /* const log = await new this.client.db.Moderation(logInput); await log.save();