пж работай

This commit is contained in:
JonnyBro 2022-08-06 22:35:01 +05:00
parent 08167fd3ad
commit 5f28f4275e
2 changed files with 8 additions and 6 deletions

View file

@ -68,7 +68,7 @@ class JaBa extends Client {
if (track.durationMS > 1) { if (track.durationMS > 1) {
setTimeout(() => { setTimeout(() => {
if (m.deletable) m.delete(); if (m.deletable) m.delete();
}, track.durationMS * 1000); }, track.durationMS);
} else { } else {
setTimeout(() => { setTimeout(() => {
if (m.deletable) m.delete(); if (m.deletable) m.delete();

View file

@ -36,10 +36,10 @@ class Play extends BaseCommand {
async execute(client, interaction) { async execute(client, interaction) {
await interaction.deferReply(); await interaction.deferReply();
const voice = interaction.member.voice.channel; const voice = interaction.member.voice.channel;
if (!voice) return interaction.error("music/play:NO_VOICE_CHANNEL"); if (!voice) return interaction.editReply({ content: interaction.translate("music/play:NO_VOICE_CHANNEL") });
const query = interaction.options.getString("query"); const query = interaction.options.getString("query");
const perms = voice.permissionsFor(client.user); const perms = voice.permissionsFor(client.user);
if (!perms.has(PermissionsBitField.Flags.Connect) || !perms.has(PermissionsBitField.Flags.Speak)) return interaction.error("music/play:VOICE_CHANNEL_CONNECT"); if (!perms.has(PermissionsBitField.Flags.Connect) || !perms.has(PermissionsBitField.Flags.Speak)) return interaction.editReply({ content: interaction.translate("music/play:VOICE_CHANNEL_CONNECT") });
const searchResult = await client.player.search(query, { const searchResult = await client.player.search(query, {
requestedBy: interaction.user, requestedBy: interaction.user,
@ -75,10 +75,12 @@ class Play extends BaseCommand {
}); });
} catch (e) { } catch (e) {
client.player.deleteQueue(interaction.guildId); client.player.deleteQueue(interaction.guildId);
interaction.error("music/play:ERR_OCCURRED", {
error: e
});
console.error(e); console.error(e);
return interaction.editReply({
content: interaction.translate("music/play:ERR_OCCURRED", {
error: e
})
});
} }
} }
} }