forked from Ubaid7/Discord.JS-V12-Bot-Tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} |