diff --git a/clear-queue.js b/clear-queue.js new file mode 100644 index 0000000..c597edc --- /dev/null +++ b/clear-queue.js @@ -0,0 +1,21 @@ +const Discord = require("discord.js") +const fs = require("fs") +const emotes = require ("../config/emojis.json") + +module.exports.run = async (client, message, args) => { + + if(!message.member.voice.channel) return message.channel.send(`**You're not in a voice channel ${emotes.error}**`) + + if(!client.player.isPlaying(message.guild.id)) return message.channel.send(`**No music playing on this server ${emotes.error}**`) + + client.player.clearQueue(message.guild.id); + + message.channel.send(`**Queue cleared ${emotes.success}**`); + + +} + +module.exports.config = { + name: "clear-queue", + aliases: [] +} \ No newline at end of file diff --git a/now-playing.js b/now-playing.js new file mode 100644 index 0000000..5a79460 --- /dev/null +++ b/now-playing.js @@ -0,0 +1,21 @@ +const Discord = require("discord.js") +const fs = require("fs") +const emotes = require ("../config/emojis.json") + +module.exports.run = async (client, message, args) => { + + if(!message.member.voice.channel) return message.channel.send(`**You're not in a voice channel ${emotes.error}**`) + + if(!client.player.isPlaying(message.guild.id)) return message.channel.send(`**No music playing on this server ${emotes.error}**`) + + let song = await client.player.nowPlaying(message.guild.id); + + message.channel.send(`**Currently playing ${song.name} ${emotes.music}**`); + + +} + +module.exports.config = { + name: "now-playing", + aliases: [] +} \ No newline at end of file diff --git a/queue.js b/queue.js new file mode 100644 index 0000000..fe6c4f6 --- /dev/null +++ b/queue.js @@ -0,0 +1,23 @@ +const Discord = require("discord.js") +const fs = require("fs") +const emotes = require ("../config/emojis.json") + +module.exports.run = async (client, message, args) => { + + if(!message.member.voice.channel) return message.channel.send(`**You're not in a voice channel ${emotes.error}**`) + + let queue = client.player.getQueue(message.guild.id); + + if(!queue) return message.channel.send(`**No songs currently playing ${emotes.error}**`); + + message.channel.send(`**Server queue ${emotes.queue}** \n`+(queue.songs.map((song, i) => { + return `${i === 0 ? 'Current' : `#${i+1}`} - ${song.name} | ${song.author}` + }).join('\n'))); + +} + + +module.exports.config = { + name: "queue", + aliases: [] +} \ No newline at end of file diff --git a/set-volume.js b/set-volume.js new file mode 100644 index 0000000..a693d47 --- /dev/null +++ b/set-volume.js @@ -0,0 +1,23 @@ +const Discord = require("discord.js") +const fs = require("fs") +const emotes = require ("../config/emojis.json") + +module.exports.run = async (client, message, args) => { + + if(!message.member.voice.channel) return message.channel.send(`**You're not in a voice channel ${emotes.error}**`) + + if(!client.player.isPlaying(message.guild.id)) return message.channel.send(`**No music playing on this server ${emotes.error}**`) + if (!args[0]) return message.channel.send(`**Please enter a number ${emotes.error}**`) + if (isNaN(args[0])) return message.channel.send(`**Please enter a valid number ${emotes.error}**`) + + client.player.setVolume(message.guild.id, parseInt(args.join(" "))); + + message.channel.send("**Volume set to** `" + args.join(" ") + "`" + `** ** ${emotes.success}`); + + +} + +module.exports.config = { + name: "set-volume", + aliases: [] +} \ No newline at end of file diff --git a/skip.js b/skip.js new file mode 100644 index 0000000..401d316 --- /dev/null +++ b/skip.js @@ -0,0 +1,21 @@ +const Discord = require("discord.js") +const fs = require("fs") +const emotes = require ("../config/emojis.json") + +module.exports.run = async (client, message, args) => { + + if(!message.member.voice.channel) return message.channel.send(`**You're not in a voice channel ${emotes.error}**`) + + if(!client.player.isPlaying(message.guild.id)) return message.channel.send(`**No music playing on this server ${emotes.error}**`) + + let song = await client.player.skip(message.guild.id); + + message.channel.send(`**Song ${song.name} skipped ${emotes.success}**`); + + +} + +module.exports.config = { + name: "skip", + aliases: [] +} \ No newline at end of file diff --git a/stop.js b/stop.js new file mode 100644 index 0000000..156171c --- /dev/null +++ b/stop.js @@ -0,0 +1,21 @@ +const Discord = require("discord.js") +const fs = require("fs") +const emotes = require ("../config/emojis.json") + +module.exports.run = async (client, message, args) => { + + if(!message.member.voice.channel) return message.channel.send(`**You're not in a voice channel ${emotes.error}**`) + + if(!client.player.isPlaying(message.guild.id)) return message.channel.send(`**No music playing on this server ${emotes.error}**`) + + client.player.stop(message.guild.id); + + message.channel.send(`**Music stopped ${emotes.success}**`); + + +} + +module.exports.config = { + name: "stop", + aliases: [] +} \ No newline at end of file