mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -05:00
add music queue command and beautify nowplaying
This commit is contained in:
parent
a80298567f
commit
ecaf7900e6
1 changed files with 23 additions and 2 deletions
|
@ -133,7 +133,7 @@ module.exports = {
|
|||
description: 'Plays music',
|
||||
alias: [],
|
||||
trusted: 0,
|
||||
usage: '<play|playurl|stop|loop|list|skip|loop|nowplaying> <song|all|current|off>',
|
||||
usage: '<play|playurl|stop|loop|list|skip|loop|nowplaying|queue> <song|all|current|off>',
|
||||
execute: function(bot, username, usernameraw, sender, prefix, args) {
|
||||
if (args[0] === 'play') {
|
||||
play(bot, args.slice(1));
|
||||
|
@ -169,7 +169,28 @@ module.exports = {
|
|||
} else if (args[0] === 'list') {
|
||||
list(bot, false, null, prefix);
|
||||
} else if (args[0] === 'nowplaying') {
|
||||
bot.tellraw('@a', [{text: 'Now playing '}, {text: bot.music.song.name, color: 'gold'}]);
|
||||
bot.tellraw('@a', [
|
||||
{
|
||||
text: 'Now playing ',
|
||||
},
|
||||
{
|
||||
text: bot.music.song.name,
|
||||
color: 'gold',
|
||||
},
|
||||
]);
|
||||
} else if (args[0] === 'queue') {
|
||||
const queueWithName = [];
|
||||
bot.music.queue.forEach((song) => queueWithName.push(song.name));
|
||||
bot.tellraw('@a', [
|
||||
{
|
||||
text: 'Queue: ',
|
||||
color: 'green',
|
||||
},
|
||||
{
|
||||
text: queueWithName.join(', '),
|
||||
color: 'aqua',
|
||||
},
|
||||
]);
|
||||
} else {
|
||||
throw new SyntaxError('Invalid argument');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue