nyx/commands/Music/pause.js

19 lines
692 B
JavaScript
Raw Normal View History

2021-06-12 12:53:51 +02:00
module.exports = {
name: "pause",
2021-07-13 05:17:39 +02:00
aliases: ["ps"],
description: "Pauses the current playing music",
2021-06-12 12:53:51 +02:00
category: "Music",
run: async (client, message, args) => {
2021-07-13 05:17:39 +02:00
const player = message.client.manager.get(message.guild.id);
if (!player) return client.err(message, "Music", "pause", 34);
const { channel } = message.member.voice;
if (!channel) return client.err(message, "Music", "pause", 35);
if (channel.id !== player.voiceChannel)
return client.err(message, "Music", "pause", 55);
if (player.paused)
return message.inlineReply("The player is already paused");
player.pause(true);
return message.inlineReply("The player is paused");
2021-06-12 12:53:51 +02:00
},
};