From 12aab5aa5612c4e126074274624e573cd36c28d6 Mon Sep 17 00:00:00 2001 From: Hiroyuki Date: Sat, 11 Sep 2021 16:42:44 -0400 Subject: [PATCH] fix: argument parsing --- src/commands/usermod.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands/usermod.ts b/src/commands/usermod.ts index 1d9a1f4..fd3c8e1 100644 --- a/src/commands/usermod.ts +++ b/src/commands/usermod.ts @@ -26,7 +26,7 @@ export default class Usermod extends Command { const modifyingPropertyResponse = await this.loading(message.channel, `Modifying \`${property}\` of \`${account.username}\`'s account...`); await this.client.commands.get('notify') - .run(message, [account.username, ...(`Your email address has been changed from ${account.emailAddress} to ${value}.`.split(' '))]); + .run(message, [account.username, ...`Your email address has been changed from ${account.emailAddress} to ${value}.`.split(' ')]); await account.updateOne({ emailAddress: value }); modifyingPropertyResponse.delete(); @@ -44,7 +44,7 @@ export default class Usermod extends Command { const modifyingPropertyResponse = await this.loading(message.channel, `Modifying \`${property}\` of \`${account.username}\`'s account...`); try { await this.client.commands.get('lock') - .run(message, [account.username, ...(`Changing your username from \`${account.username}\` to \`${value}\`. DN/C`.split(' '))]); + .run(message, [account.username, ...`Changing your username from \`${account.username}\` to \`${value}\`. DN/C`.split(' ')]); await this.client.util.exec(`usermod -l ${value} ${account.username}`); await this.client.util.exec(`usermod -d /home/${value} ${account.username}`); @@ -54,10 +54,10 @@ export default class Usermod extends Command { homepath: `/home/${value}`, }); await this.client.commands.get('unlock') - .run(message, [value, ...(`Your username has been successfully changed. Remember to use \`ssh ${value}@cloud.libraryofcode.org\` when logging in.`)]); + .run(message, [value, ...`Your username has been successfully changed. Remember to use \`ssh ${value}@cloud.libraryofcode.org\` when logging in.`.split(' ')]); } catch (error) { await this.client.commands.get('unlock') - .run(message, [account.username, ...('Your username change was unsuccessful. Please contact a Technician for more details.')]); + .run(message, [account.username, ...'Your username change was unsuccessful. Please contact a Technician for more details.'.split(' ')]); this.error(message.channel, 'Failed to modify username.'); return this.client.util.handleError(error); }