From 96566b89f70ec37b1ff193b522a87939a980d504 Mon Sep 17 00:00:00 2001 From: carol Date: Thu, 13 Feb 2020 09:50:35 -0500 Subject: [PATCH] Starting to work on this --- commands/Music/play.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 commands/Music/play.js diff --git a/commands/Music/play.js b/commands/Music/play.js new file mode 100644 index 0000000..270913e --- /dev/null +++ b/commands/Music/play.js @@ -0,0 +1,27 @@ +const ytdl = require("ytdl-core"); +var servers = {}; + +exports.run = async (client, message, args, level) => { + if(!args[1] || args[1].startsWith("https://")) return (await message.reply("you need to provide a valid URL!")).delete(5000).catch(() => { }); + if(!message.member.voiceChannel) (await return message.reply("you need to be in a voice channel to use this command.")).delete(5000).catch(() => { }); + + if(!servers[message.guild.id]) servers[message.guild.id] = { + queue: [] + } + + var server = servers[message.guild.id]; +}; + +exports.conf = { + enabled: true, + guildOnly: true, + aliases: ["yt"], + permLevel: "Moderator" +}; + +exports.help = { + name: "play", + category: "Music", + description: "Play a song/playlist, or queue it if something's already playing.", + usage: "play [url]" +};