-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.js
More file actions
35 lines (35 loc) · 1.71 KB
/
utils.js
File metadata and controls
35 lines (35 loc) · 1.71 KB
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
const chalk = require('chalk');
const { Color } = require('hypixel-api-reborn');
module.exports = {
parseRank (rank, nickname, plusColor, prefixColor) {
switch (rank) {
case 'Default': {
return chalk.whiteBright(nickname);
}
case 'MVP++': {
return `${chalk.hex(prefixColor.toHex())('[MVP')}${chalk.hex(plusColor.toHex())('++')}${chalk.hex(prefixColor.toHex())('] ' + nickname)}`;//chalk.hex(prefixColor.toHex())(`[${rank}] ${nickname}`).replace(/\+/, chalk.hex(plusColor.toHex())('+'))
}
case 'MVP+':
case 'VIP+':
return `${chalk.hex(rank === 'MVP+' ? new Color('AQUA').toHex() : new Color('GREEN').toHex())(rank === 'MVP+' ? '[MVP' : '[VIP')}${rank === 'MVP+' ? chalk.hex(plusColor.toHex())('+') : chalk.hex(new Color('GOLD').toHex())('+')}${chalk.hex(rank === 'MVP+' ? new Color('AQUA').toHex() : new Color('GREEN').toHex())(rank === 'MVP+' ? '] ' + nickname : '] ' + nickname)}`;
case 'MVP':
case 'VIP':
return `${chalk.hex(rank === 'MVP' ? new Color('AQUA').toHex() : new Color('GREEN').toHex())(rank === 'MVP' ? '[MVP' : '[VIP')}${chalk.hex(rank === 'MVP' ? new Color('AQUA').toHex() : new Color('GREEN').toHex())(rank === 'MVP' ? '] ' + nickname : '] ' + nickname)}`;
case 'Helper': {
return `${chalk.hex('5555FF')(`[${rank}] ${nickname}`)}`;
}
case 'Admin': {
return `${chalk.hex('AA0000')(`[${rank}] ${nickname}`)}`;
}
case 'Moderator': {
return `${chalk.hex('00AA00')(`[${rank}] ${nickname}`)}`;
}
case 'OWNER': {
return `${chalk.hex('AA0000')(`[${rank}] ${nickname}`)}`;
}
default: {
return `${chalk.whiteBright(`[${rank}] ${nickname}`)}`;
}
}
}
};