Halfbroken fixes

This commit is contained in:
Myx
2023-06-28 03:02:41 +02:00
parent 6a001604ab
commit f533e38333
18 changed files with 545 additions and 421 deletions

View File

@@ -1,34 +1,34 @@
const { getVoiceConnection } = require("@discordjs/voice");
const { getVoiceConnection } = require('@discordjs/voice');
async function pauseCommand(interaction) {
await interaction.deferReply();
await interaction.deferReply();
const connection = getVoiceConnection(interaction.guild.id);
const connection = getVoiceConnection(interaction.guild.id);
if (!connection) {
return interaction.followUp(
"There is no active music player in this server."
);
}
if (!connection) {
return interaction.followUp(
'There is no active music player in this server.',
);
}
connection.state.subscription.player.pause();
interaction.followUp("Paused the music.");
connection.state.subscription.player.pause();
return interaction.followUp('Paused the music.');
}
async function unpauseCommand(interaction) {
await interaction.deferReply();
await interaction.deferReply();
const connection = getVoiceConnection(interaction.guild.id);
const connection = getVoiceConnection(interaction.guild.id);
if (!connection) {
return interaction.followUp(
"There is no active music player in this server."
);
}
if (!connection) {
return interaction.followUp(
'There is no active music player in this server.',
);
}
connection.state.subscription.player.unpause();
interaction.followUp("Resumed the music.");
connection.state.subscription.player.unpause();
return interaction.followUp('Resumed the music.');
}
module.exports.pauseCommand = pauseCommand;
module.exports.unpauseCommand = unpauseCommand;
module.exports.unpauseCommand = unpauseCommand;