forked from engineering/cloudservices
Clean up
parent
a979f73890
commit
d534ea163d
|
@ -25,10 +25,8 @@ export default class Lock extends Command {
|
||||||
await account.updateOne({ locked: true });
|
await account.updateOne({ locked: true });
|
||||||
|
|
||||||
const expiry = new Date();
|
const expiry = new Date();
|
||||||
const lockLength = args[1].match(/[a-z]+|[^a-z]+/gi);
|
const [length, unit] = args[1].match(/[a-z]+|[^a-z]+/gi);
|
||||||
const length = Number(lockLength[0]);
|
const momentMilliseconds = moment.duration(Number(length), unit as unitOfTime.Base).asMilliseconds();
|
||||||
const unit = lockLength[1] as unitOfTime.Base;
|
|
||||||
const momentMilliseconds = moment.duration(length, unit).asMilliseconds();
|
|
||||||
const reason = momentMilliseconds ? args.slice(2).join(' ') : args.slice(1).join(' ');
|
const reason = momentMilliseconds ? args.slice(2).join(' ') : args.slice(1).join(' ');
|
||||||
|
|
||||||
await this.client.util.createModerationLog(account.userID, message.member, 2, reason, momentMilliseconds);
|
await this.client.util.createModerationLog(account.userID, message.member, 2, reason, momentMilliseconds);
|
||||||
|
|
Loading…
Reference in New Issue