Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

Commit

Permalink
Update Music
Browse files Browse the repository at this point in the history
  • Loading branch information
HELLSNAKES committed Oct 2, 2021
1 parent 1af395a commit 6496453
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 32 deletions.
7 changes: 7 additions & 0 deletions commands/Music/autoplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ module.exports = {
run : async(client, message, args) => {
if(!message.member.voice.channel)
return message.reply('Please join a voice channel!');
let queue = client.distube.getQueue(message);
if (!queue) {
const queueError = new Discord.MessageEmbed()
.setDescription("There is Nothing Playing")
.setColor("RANDOM")
return message.channel.send(queueError)
}
let mode = client.distube.toggleAutoplay(message);
return message.reply("Set autoplay mode to `" + (mode ? "On" : "Off") + "`");
}
Expand Down
7 changes: 7 additions & 0 deletions commands/Music/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ module.exports = {
run: async (client, message, args) => {
if (!message.member.voice.channel)
return message.reply('Please join a voice channel!')
let queue = client.distube.getQueue(message);
if (!queue) {
const queueError = new Discord.MessageEmbed()
.setDescription("There is Nothing Playing")
.setColor("RANDOM")
return message.channel.send(queueError)
}
if (filters.includes(args[0])) {
const filter = client.distube.setFilter(message, args[0]);
await message.react('👌')
Expand Down
13 changes: 10 additions & 3 deletions commands/Music/loop.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ module.exports = {
timeout: 3000,
usage: "[command]",
author: "[CuSO4-c3c,Hiyoriii,Hellsnakes]",
run : async(client, message, args) => {
if(!message.member.voice.channel)
return message.reply('Please join a voice channel!');
run: async (client, message, args) => {
if (!message.member.voice.channel)
return message.reply('Please join a voice channel!');
let queue = client.distube.getQueue(message);
if (!queue) {
const queueError = new Discord.MessageEmbed()
.setDescription("There is Nothing Playing")
.setColor("RANDOM")
return message.channel.send(queueError)
}
await client.distube.setRepeatMode(message, parseInt(args[0]));
await message.react('🔁');
}
Expand Down
7 changes: 5 additions & 2 deletions commands/Music/nowplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ module.exports = {
run: async (client, message, args) => {
if (!message.member.voice.channel)
return message.reply('Please join a voice channel!')
const queue = client.distube.getQueue(message)
let queue = client.distube.getQueue(message);
if (!queue) {
return message.reply(`There are currently no songs`);
const queueError = new Discord.MessageEmbed()
.setDescription("There is Nothing Playing")
.setColor("RANDOM")
return message.channel.send(queueError)
}
const song = queue.songs[0]
const embed = new Discord.MessageEmbed()
Expand Down
13 changes: 10 additions & 3 deletions commands/Music/pause.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ module.exports = {
timeout: 3000,
usage: "[command]",
author: "[CuSO4-c3c,Hiyoriii,Hellsnakes]",
run : async(client, message, args) => {
if(!message.member.voice.channel)
return message.reply('Please join a voice channel!');
run: async (client, message, args) => {
if (!message.member.voice.channel)
return message.reply('Please join a voice channel!');
let queue = client.distube.getQueue(message);
if (!queue) {
const queueError = new Discord.MessageEmbed()
.setDescription("There is Nothing Playing")
.setColor("RANDOM")
return message.channel.send(queueError)
}
await client.distube.pause(message)
await message.react('⏸');
}
Expand Down
13 changes: 10 additions & 3 deletions commands/Music/resume.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ module.exports = {
timeout: 3000,
usage: "[command]",
author: "[CuSO4-c3c,Hiyoriii,Hellsnakes]",
run : async(client, message, args) => {
if(!message.member.voice.channel)
return message.reply('Please join a voice channel!');
run: async (client, message, args) => {
if (!message.member.voice.channel)
return message.reply('Please join a voice channel!');
let queue = client.distube.getQueue(message);
if (!queue) {
const queueError = new Discord.MessageEmbed()
.setDescription("There is Nothing Playing")
.setColor("RANDOM")
return message.channel.send(queueError)
}
await client.distube.resume(message)
await client.distube.pause(message)
await client.distube.resume(message)
Expand Down
13 changes: 10 additions & 3 deletions commands/Music/shuffle.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@ module.exports = {
timeout: 3000,
usage: "[command]",
author: "[Harmonynos Team]",
run : async(client, message, args) => {
if(!message.member.voice.channel)
return message.reply('Please join a voice channel!');
run: async (client, message, args) => {
if (!message.member.voice.channel)
return message.reply('Please join a voice channel!');
let queue = client.distube.getQueue(message);
if (!queue) {
const queueError = new Discord.MessageEmbed()
.setDescription("There is Nothing Playing")
.setColor("RANDOM")
return message.channel.send(queueError)
}
await client.distube.shuffle(message)
await message.react('🔀');
}
Expand Down
13 changes: 10 additions & 3 deletions commands/Music/skip.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ module.exports = {
timeout: 3000,
usage: "[command]",
author: "[CuSO4-c3c,Hiyoriii,Hellsnakes]",
run : async(client, message, args) => {
if(!message.member.voice.channel)
return message.reply('Please join a voice channel!');
run: async (client, message, args) => {
if (!message.member.voice.channel)
return message.reply('Please join a voice channel!');
let queue = client.distube.getQueue(message);
if (!queue) {
const queueError = new Discord.MessageEmbed()
.setDescription("There is Nothing Playing")
.setColor("RANDOM")
return message.channel.send(queueError)
}
await client.distube.skip(message)
await message.react('⏭');
}
Expand Down
11 changes: 7 additions & 4 deletions commands/Music/skiptotime.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@ module.exports = {
usage: "[command]",
author: "[Harmonynos Team]",
run: async (client, message, args) => {
if (!message.member.voice.channel) {
if (!message.member.voice.channel)
return message.reply('Please join a voice channel!');
}
let queue = client.distube.getQueue(message);
if (!queue) {
return message.reply(`There are currently no songs`);
const queueError = new Discord.MessageEmbed()
.setDescription("There is Nothing Playing")
.setColor("RANDOM")
return message.channel.send(queueError)
}
let time = parseInt(args[0]);
if(!time) return message.reply("Please specify a time | Time in seconds.")
if (!time) return message.reply("Please specify a time | Time in seconds.")
if (time >= queue.songs[0].duration) return message.reply(`Time < \`${queue.songs[0].duration} seconds\``)
client.distube.seek(message, Number(args[0] * 1000));
await message.react('⏩');
message.reply(`Skip time to \`${args[0]} seconds\``);
Expand Down
13 changes: 10 additions & 3 deletions commands/Music/stop.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ module.exports = {
timeout: 3000,
usage: "[command]",
author: "[CuSO4-c3c,Hiyoriii,Hellsnakes]",
run : async(client, message, args) => {
if(!message.member.voice.channel)
return message.reply('Please join a voice channel!');
run: async (client, message, args) => {
if (!message.member.voice.channel)
return message.reply('Please join a voice channel!');
let queue = client.distube.getQueue(message);
if (!queue) {
const queueError = new Discord.MessageEmbed()
.setDescription("There is Nothing Playing")
.setColor("RANDOM")
return message.channel.send(queueError)
}
await client.distube.stop(message)
await message.react('⏹');
}
Expand Down
23 changes: 15 additions & 8 deletions commands/Music/volume.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,25 @@ const progressbar = require('string-progressbar');

module.exports = {
name: "volume",
category : "Music",
aliases : ['v'],
description : "Change the music player's volume.",
category: "Music",
aliases: ['v'],
description: "Change the music player's volume.",
timeout: 3000,
usage: '[command]+[amount]',
author: "[CuSO4-c3c,Hiyoriii,Hellsnakes]",
run: async(client, message, args) => {
if(!message.member.voice.channel)
return message.reply('Please join a voice channel!')
run: async (client, message, args) => {
if (!message.member.voice.channel)
return message.reply('Please join a voice channel!')
let queue = client.distube.getQueue(message);
if (!queue) {
const queueError = new Discord.MessageEmbed()
.setDescription("There is Nothing Playing")
.setColor("RANDOM")
return message.channel.send(queueError)
}
let amount = parseInt(args[0]);
if(!amount) return message.channel.send("Please specify a volume.")
if(amount > 100) {
if (!amount) return message.channel.send("Please specify a volume.")
if (amount > 100) {
message.channel.send("Please enter a valid number (between 1 and 100)")
} else {
client.distube.setVolume(message, amount);
Expand Down

0 comments on commit 6496453

Please sign in to comment.