From 0dcb367cc823a0910dc194b1f38e843f885032e3 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Wed, 11 Dec 2019 22:20:43 -0500 Subject: [PATCH] fixes an issue with account name in cacc being set to command invoker --- src/commands/createaccount.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/createaccount.ts b/src/commands/createaccount.ts index aff9360..69ae920 100644 --- a/src/commands/createaccount.ts +++ b/src/commands/createaccount.ts @@ -40,7 +40,7 @@ export default class CreateAccount extends Command { const tempPass = this.client.util.randomPassword(); 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]},,`; await this.client.util.createAccount(passHash, etcPasswd, args[2], args[0], args[1], message.author.id);