diff --git a/commands/music/remove.js b/commands/music/remove.js new file mode 100644 index 0000000..e462a07 --- /dev/null +++ b/commands/music/remove.js @@ -0,0 +1,38 @@ +const { Command } = require('discord.js-commando'); +const { MessageEmbed } = require('discord.js'); + +module.exports = class JoinCommand extends Command { + constructor(client) { + super(client, { + name: 'remove', + memberName: 'remove', + group: 'music', + description: 'removes a track from the queue', + guildOnly: true, + throttling: { + usages: 1, + duration: 3 + } + }); + } + + run = async message => { + try { + if (!message.member.voice.channel) { + const embed = new MessageEmbed().setColor('#ff0000').setTitle(':x: You need to join a voice channel first'); + return await message.say({ embed }); + } + else if (!message.guild.music.isPlaying) { + const embed = new MessageEmbed().setColor('#ff0000').setTitle(':x: Play something first'); + return await message.say({ embed }); + } + else { + // TODO remove logic goes here + } + } catch (err) { + console.error(err); + const embed = new MessageEmbed().setColor('#ff0000').setTitle(`:x: Error occured: ${err.message}`); + return message.say({ embed }); + } + } +} \ No newline at end of file diff --git a/commands/music/search.js b/commands/music/search.js new file mode 100644 index 0000000..b18f417 --- /dev/null +++ b/commands/music/search.js @@ -0,0 +1,38 @@ +const { Command } = require('discord.js-commando'); +const { MessageEmbed } = require('discord.js'); + +module.exports = class JoinCommand extends Command { + constructor(client) { + super(client, { + name: 'search', + memberName: 'search', + group: 'music', + description: 'search and play a track in youtube', + guildOnly: true, + throttling: { + usages: 1, + duration: 3 + } + }); + } + + run = async message => { + try { + if (!message.member.voice.channel) { + const embed = new MessageEmbed().setColor('#ff0000').setTitle(':x: You need to join a voice channel first'); + return await message.say({ embed }); + } + else if (!message.guild.music.isPlaying) { + const embed = new MessageEmbed().setColor('#ff0000').setTitle(':x: Play something first'); + return await message.say({ embed }); + } + else { + // TODO search logic goes here + } + } catch (err) { + console.error(err); + const embed = new MessageEmbed().setColor('#ff0000').setTitle(`:x: Error occured: ${err.message}`); + return message.say({ embed }); + } + } +} \ No newline at end of file diff --git a/commands/music/seek.js b/commands/music/seek.js new file mode 100644 index 0000000..aa17194 --- /dev/null +++ b/commands/music/seek.js @@ -0,0 +1,38 @@ +const { Command } = require('discord.js-commando'); +const { MessageEmbed } = require('discord.js'); + +module.exports = class JoinCommand extends Command { + constructor(client) { + super(client, { + name: 'seek', + memberName: 'seek', + group: 'music', + description: 'seeks to a timestamp in the track', + guildOnly: true, + throttling: { + usages: 1, + duration: 3 + } + }); + } + + run = async message => { + try { + if (!message.member.voice.channel) { + const embed = new MessageEmbed().setColor('#ff0000').setTitle(':x: You need to join a voice channel first'); + return await message.say({ embed }); + } + else if (!message.guild.music.isPlaying) { + const embed = new MessageEmbed().setColor('#ff0000').setTitle(':x: Play something first'); + return await message.say({ embed }); + } + else { + // TODO seek logic goes here + } + } catch (err) { + console.error(err); + const embed = new MessageEmbed().setColor('#ff0000').setTitle(`:x: Error occured: ${err.message}`); + return message.say({ embed }); + } + } +} \ No newline at end of file