nice i added music list colors

This commit is contained in:
ChomeNS 2022-08-17 20:39:25 +07:00
parent 327e99e0a3
commit 4f92ea97ee
3 changed files with 15 additions and 8 deletions

View file

@ -1,8 +1,4 @@
[
"Validate command",
"New hash system",
"Fixed cloop command",
"Alias support for *help [command]",
"Music command",
"Better auto refill on core break (instead of clooping fill core command in the core)"
"Better auto refill on core break (instead of clooping fill core command in the core)",
"*music list colors"
]

View file

@ -61,7 +61,19 @@ module.exports = {
const absolutePath = await resolve(SONGS_PATH);
const listed = await list(absolutePath);
bot.core.run('minecraft:tellraw @a ' + JSON.stringify({text: listed.join(''), color: 'green'}));
let color = '§4';
let message = '';
listed.forEach((value) => {
if (color==='§4') {
color = '§e';
} else if (color==='§e') {
color = '§4';
};
message += color + value + ' ';
});
bot.core.run('minecraft:tellraw @a ' + JSON.stringify({text: message, color: 'red'}));
};
if (args[0]==='play') {

View file

@ -6,7 +6,6 @@ async function list (filepath = '.') {
const component = []
files.forEach((filename, index) => {
component.push(filename)
if (index !== files.length - 1) component.push(' ')
})
return component
}