Files
xiao/commands/util-voice/pause.js
T
Dragon Fire bf0514c73c Fix
2024-03-20 01:22:00 -04:00

27 lines
833 B
JavaScript

const Command = require('../../framework/Command');
const { getVoiceConnection } = require('@discordjs/voice');
module.exports = class PauseCommand extends Command {
constructor(client) {
super(client, {
name: 'pause',
aliases: ['pause-voice-channel', 'pause-vc', 'pause-voice', 'pause-music', 'pause-playing'],
group: 'util-voice',
memberName: 'pause',
description: 'Pauses the current audio playing.',
guildOnly: true,
guarded: true
});
}
run(msg) {
const connection = getVoiceConnection(msg.guild.id);
if (!connection) return msg.reply('I am not in a voice channel.');
if (!this.client.dispatchers.has(msg.guild.id)) {
return msg.reply(`I am not currently playing audio in this server.`);
}
this.client.dispatchers.get(msg.guild.id).pause();
return msg.reply('Paused playing.');
}
};