mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -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",
|
||||
"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"
|
||||
]
|
|
@ -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') {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue