Skip to content

Commit

Permalink
Music BOT:- Skip Command
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubaid7 authored Jan 28, 2021
1 parent a58f34a commit e7877e3
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Episode 11/commands/Music/skip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const { MessageEmbed } = require("discord.js")

module.exports = {
commands: ['skip', 'sk'], // You Can Keep Any Name
description: 'Skips The Music', // Optional

callback: async(message, args) => {
const channel = message.member.voice // VC Of User
const queue = message.client.queue.get(message.guild.id) // To Check If Music Is Being Played.
if(!channel) return message.reply('You need To be In A VC To Skip Music.')
const serverQueue = message.client.queue.get(message.guild.id) // To Check If Music Is Being Played.
if(!serverQueue) return message.reply('No Song Being Played, Cant Skip.') // If No Song Is Being Played.
if(queue.repeatMode === 1) { queue.repeatMode = 0 }
serverQueue.connection.dispatcher.end('Song Skipped.')
// message.channel.send('Song Skipped.')

const embed = new MessageEmbed()
.setTitle('Music Skipped')
.setDescription('Music Has Been Skipped.')
.addField('Skipped By:-', message.author)
.setTimestamp()
.setColor('RANDOM')
.setFooter('Song Skipped')
message.channel.send(embed)
}
}

0 comments on commit e7877e3

Please sign in to comment.