fix: usermod bug fixes

pull/15/head
Hiroyuki 2021-09-14 14:42:22 -04:00
parent 2bad7fb05a
commit 785baaa902
No known key found for this signature in database
GPG Key ID: AF65958B7B7362E6
3 changed files with 6 additions and 2 deletions

View File

@ -51,7 +51,7 @@ export default class Modlogs extends Command {
});
if (embeds.length === 1) {
msg.edit({ embeds: [embeds[0]] });
msg.edit({ content: null, embeds: [embeds[0]] });
} else {
this.client.util.createPaginationEmbed(message, embeds);
}

View File

@ -1,4 +1,5 @@
import { Message } from 'discord.js';
import { rename } from 'fs/promises';
import { Client, Command } from '../class';
import { LINUX_USERNAME_REGEX } from '../class/AccountUtil';
@ -7,6 +8,7 @@ export default class Usermod extends Command {
super(client);
this.name = 'usermod';
this.description = 'Modifies properties of a user\'s cloud account';
this.usage = `${this.client.config.prefix}usermod [account] [property: username | email] [value]`;
this.permissions = { roles: ['662163685439045632', '701454780828221450'] };
this.enabled = true;
}
@ -51,7 +53,9 @@ export default class Usermod extends Command {
}
await this.client.util.exec(`usermod -l ${value} ${account.username}`);
await rename(account.homepath, `/home/${value}`);
await this.client.util.exec(`usermod -d /home/${value} ${value}`);
await this.client.util.exec(`groupmod -n ${value} ${account.username}`);
await account.updateOne({
username: value,

View File

@ -57,7 +57,7 @@ export default class Users extends Command {
});
if (embeds.length === 1) {
msg.edit({ embeds: [embeds[0]] });
msg.edit({ content: null, embeds: [embeds[0]] });
} else {
msg.delete();
this.client.util.createPaginationEmbed(message, embeds);