fixes an issue with account name in cacc being set to command invoker

merge-requests/1/merge
Matthew 2019-12-11 22:20:43 -05:00
parent 24db3a2513
commit 0dcb367cc8
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@ export default class CreateAccount extends Command {
const tempPass = this.client.util.randomPassword(); const tempPass = this.client.util.randomPassword();
let passHash = await this.client.util.createHash(tempPass); passHash = passHash.replace(/[$]/g, '\\$').replace('\n', ''); let passHash = await this.client.util.createHash(tempPass); passHash = passHash.replace(/[$]/g, '\\$').replace('\n', '');
const acctName = message.author.username.replace(/[!@#$%^&*(),.?":{}|<>]/g, '-').replace(/\s/g, '-'); const acctName = this.client.users.get(args[0]).username.replace(/[!@#$%^&*(),.?":{}|<>]/g, '-').replace(/\s/g, '-');
const etcPasswd = `${acctName},${args[0]},,`; const etcPasswd = `${acctName},${args[0]},,`;
await this.client.util.createAccount(passHash, etcPasswd, args[2], args[0], args[1], message.author.id); await this.client.util.createAccount(passHash, etcPasswd, args[2], args[0], args[1], message.author.id);