Merge branch 'master' of gitlab.libraryofcode.org:engineering/cloudservices-rewrite
commit
613c709e52
|
@ -117,7 +117,7 @@ export default class Util {
|
||||||
|
|
||||||
public randomPassword(): string {
|
public randomPassword(): string {
|
||||||
let tempPass = ''; const passChars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'];
|
let tempPass = ''; const passChars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'];
|
||||||
tempPass += passChars[Math.floor(Math.random() * passChars.length)];
|
while (tempPass.length < 5) { tempPass += passChars[Math.floor(Math.random() * passChars.length)]; }
|
||||||
return tempPass;
|
return tempPass;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ export default class CreateAccount extends Command {
|
||||||
+ 'You may now return to Modmail, and continue setting up your account from there.\n\n'
|
+ 'You may now return to Modmail, and continue setting up your account from there.\n\n'
|
||||||
+ 'An email containing some useful information has also been sent').catch();
|
+ 'An email containing some useful information has also been sent').catch();
|
||||||
|
|
||||||
return confirmation.edit(`${this.client.stores.emojis.success} ***Account successfully created***\n**Username:** \`${args[3]}\`\n**Temporary Password:** \`${tempPass}\``);
|
return confirmation.edit(`${this.client.stores.emojis.success} ***Account successfully created***\n**Username:** \`${args[2]}\`\n**Temporary Password:** \`${tempPass}\``);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return this.client.util.handleError(error, message, this);
|
return this.client.util.handleError(error, message, this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,11 +35,11 @@ export default class DeleteAccount extends Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
const deleting = await message.channel.createMessage(`${this.client.stores.emojis.loading} ***Deleteing account, please wait...***`);
|
const deleting = await message.channel.createMessage(`${this.client.stores.emojis.loading} ***Deleteing account, please wait...***`);
|
||||||
await this.client.util.deleteAccount(username);
|
|
||||||
const reason = args.slice(1).join(' ');
|
const reason = args.slice(1).join(' ');
|
||||||
const logInput = { username, userID, logID: uuid(), moderatorID: message.author.id, type: 4, date: new Date(), reason: null };
|
const logInput = { username, userID, logID: uuid(), moderatorID: message.author.id, type: 4, date: new Date(), reason: null };
|
||||||
if (reason) logInput.reason = reason;
|
if (reason) logInput.reason = reason;
|
||||||
await this.client.util.createModerationLog(args[0], message.member, 4, reason);
|
await this.client.util.createModerationLog(args[0], message.member, 4, reason);
|
||||||
|
await this.client.util.deleteAccount(username);
|
||||||
/*
|
/*
|
||||||
const log = await new this.client.db.Moderation(logInput);
|
const log = await new this.client.db.Moderation(logInput);
|
||||||
await log.save();
|
await log.save();
|
||||||
|
|
Loading…
Reference in New Issue