mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2025-02-20 03:04:45 -05:00
nice i added music list colors
This commit is contained in:
parent
327e99e0a3
commit
4f92ea97ee
3 changed files with 15 additions and 8 deletions
|
@ -1,8 +1,4 @@
|
||||||
[
|
[
|
||||||
"Validate command",
|
"Better auto refill on core break (instead of clooping fill core command in the core)",
|
||||||
"New hash system",
|
"*music list colors"
|
||||||
"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)"
|
|
||||||
]
|
]
|
|
@ -61,7 +61,19 @@ module.exports = {
|
||||||
const absolutePath = await resolve(SONGS_PATH);
|
const absolutePath = await resolve(SONGS_PATH);
|
||||||
const listed = await list(absolutePath);
|
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') {
|
if (args[0]==='play') {
|
||||||
|
|
|
@ -6,7 +6,6 @@ async function list (filepath = '.') {
|
||||||
const component = []
|
const component = []
|
||||||
files.forEach((filename, index) => {
|
files.forEach((filename, index) => {
|
||||||
component.push(filename)
|
component.push(filename)
|
||||||
if (index !== files.length - 1) component.push(' ')
|
|
||||||
})
|
})
|
||||||
return component
|
return component
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue