mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-25 14:44:58 +05:00
пж работай
This commit is contained in:
parent
08167fd3ad
commit
5f28f4275e
2 changed files with 8 additions and 6 deletions
|
@ -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();
|
||||||
|
|
|
@ -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
|
||||||
|
})
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue