-
Notifications
You must be signed in to change notification settings - Fork 0
/
pswd.ts
54 lines (46 loc) · 1.31 KB
/
pswd.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
HELLO THERE VISITOR! SEEMS LIKE YOU MADE IT THIS FAR!
This is where the password is generated. Generated sounds like
it is random but no, it is not. As a CTO, you should be able to
read and understand the code to find out the password you need
to get your admin permissions
Good Luck
PS: While you're here, you could also star the repository :3
- Unknown
*/
import { codify } from './functions';
function getFirst(): string {
return [Map, Error, [[String]]]
.flat(2)
.map((v) => v.name.slice(0, 1).toLowerCase())
.concat([
(typeof '').slice(0, [0].length),
...Array.from(new Set(Error.name.replace(/[^age]/g, '').split('')))
.join('')
.toLowerCase()
])
.join('');
}
function getThird(text: string): string {
return text
.split('')
.map((c) => {
if (['a', 'e', 'i', 'o', 'u'].includes(c.toLowerCase())) {
return c.toLowerCase();
} else {
return c;
}
})
.join('-');
}
export async function getPassword(message: discord.Message): Promise<string> {
let first = getFirst().toUpperCase();
let second = await codify(message, message.author.username);
second = second
.toLowerCase()
.replace('n', '')
.slice(0, 4)
.toUpperCase();
let t = getThird(first + second);
return t;
}