fix: usermod bug fixes
parent
2bad7fb05a
commit
785baaa902
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue