mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-27 09:35:35 -05:00
fix stuff
This commit is contained in:
parent
74efceebc5
commit
872d134b65
1 changed files with 21 additions and 1 deletions
|
@ -138,8 +138,10 @@ module.exports = {
|
|||
switch (args[0]) {
|
||||
case 'play':
|
||||
play(bot, args.slice(1));
|
||||
break;
|
||||
case 'playurl':
|
||||
playUrl(bot, args.slice(1));
|
||||
break;
|
||||
case 'stop':
|
||||
try {
|
||||
bot.tellraw('@a', {text: 'Cleared the song queue'});
|
||||
|
@ -147,6 +149,7 @@ module.exports = {
|
|||
return;
|
||||
}
|
||||
bot.music.stop();
|
||||
break;
|
||||
case 'skip':
|
||||
try {
|
||||
bot.tellraw('@a', [{text: 'Skipping '}, {text: bot.music.song.name, color: 'gold'}]);
|
||||
|
@ -154,6 +157,7 @@ module.exports = {
|
|||
} catch (e) {
|
||||
throw new Error('No music is currently playing!');
|
||||
}
|
||||
break;
|
||||
case 'loop':
|
||||
switch (args[1]) {
|
||||
case 'off':
|
||||
|
@ -167,6 +171,7 @@ module.exports = {
|
|||
color: 'red',
|
||||
},
|
||||
]);
|
||||
break;
|
||||
case 'current':
|
||||
bot.music.loop = 1;
|
||||
bot.tellraw('@a', [
|
||||
|
@ -178,16 +183,19 @@ module.exports = {
|
|||
color: 'gold',
|
||||
},
|
||||
]);
|
||||
break;
|
||||
case 'all':
|
||||
bot.music.loop = 2;
|
||||
bot.tellraw('@a', {
|
||||
text: 'Now looping every song in the queue',
|
||||
});
|
||||
break;
|
||||
default:
|
||||
throw new SyntaxError('Invalid argument');
|
||||
}
|
||||
case 'list':
|
||||
list(bot, false, null, prefix);
|
||||
break;
|
||||
case 'nowplaying':
|
||||
bot.tellraw('@a', [
|
||||
{
|
||||
|
@ -198,6 +206,7 @@ module.exports = {
|
|||
color: 'gold',
|
||||
},
|
||||
]);
|
||||
break;
|
||||
case 'queue':
|
||||
const queueWithName = [];
|
||||
bot.music.queue.forEach((song) => queueWithName.push(song.name));
|
||||
|
@ -211,16 +220,20 @@ module.exports = {
|
|||
color: 'aqua',
|
||||
},
|
||||
]);
|
||||
break;
|
||||
default:
|
||||
throw new SyntaxError('Invalid argument');
|
||||
}
|
||||
},
|
||||
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) {
|
||||
let Embed;
|
||||
switch (args[0]) {
|
||||
case 'play':
|
||||
play(bot, args.slice(1), true, channeldc);
|
||||
break;
|
||||
case 'playurl':
|
||||
playUrl(bot, args.slice(1), true, channeldc);
|
||||
break;
|
||||
case 'stop':
|
||||
try {
|
||||
const Embed = new MessageEmbed()
|
||||
|
@ -232,6 +245,7 @@ module.exports = {
|
|||
return;
|
||||
}
|
||||
bot.music.stop();
|
||||
break;
|
||||
case 'skip':
|
||||
try {
|
||||
const Embed = new MessageEmbed()
|
||||
|
@ -243,8 +257,8 @@ module.exports = {
|
|||
} catch (e) {
|
||||
throw new Error('No music is currently playing!');
|
||||
}
|
||||
break;
|
||||
case 'loop':
|
||||
let Embed;
|
||||
switch (args[1]) {
|
||||
case 'off':
|
||||
bot.music.loop = 0;
|
||||
|
@ -253,6 +267,7 @@ module.exports = {
|
|||
.setTitle('Loop')
|
||||
.setDescription('Looping is now disabled');
|
||||
channeldc.send({embeds: [Embed]});
|
||||
break;
|
||||
case 'current':
|
||||
bot.music.loop = 1;
|
||||
Embed = new MessageEmbed()
|
||||
|
@ -260,6 +275,7 @@ module.exports = {
|
|||
.setTitle('Loop')
|
||||
.setDescription(`Now looping ${song.name}`);
|
||||
channeldc.send({embeds: [Embed]});
|
||||
break;
|
||||
case 'all':
|
||||
bot.music.loop = 2;
|
||||
Embed = new MessageEmbed()
|
||||
|
@ -267,15 +283,18 @@ module.exports = {
|
|||
.setTitle('Loop')
|
||||
.setDescription('Now looping every song in the queue');
|
||||
channeldc.send({embeds: [Embed]});
|
||||
break;
|
||||
}
|
||||
case 'list':
|
||||
list(bot, true, channeldc, prefix);
|
||||
break;
|
||||
case 'nowplaying':
|
||||
Embed = new MessageEmbed()
|
||||
.setColor('#FFFF00')
|
||||
.setTitle('Now playing')
|
||||
.setDescription(`Now playing ${bot.music.song.name}`);
|
||||
channeldc.send({embeds: [Embed]});
|
||||
break;
|
||||
case 'queue':
|
||||
const queueWithName = [];
|
||||
bot.music.queue.forEach((song) => queueWithName.push(song.name));
|
||||
|
@ -284,6 +303,7 @@ module.exports = {
|
|||
.setTitle('Queue')
|
||||
.setDescription(queueWithName.join(', '));
|
||||
channeldc.send({embeds: [Embed]});
|
||||
break;
|
||||
default:
|
||||
throw new SyntaxError('Invalid argument');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue