mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-21 20:54: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) {
|
||||
setTimeout(() => {
|
||||
if (m.deletable) m.delete();
|
||||
}, track.durationMS * 1000);
|
||||
}, track.durationMS);
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
if (m.deletable) m.delete();
|
||||
|
|
|
@ -36,10 +36,10 @@ class Play extends BaseCommand {
|
|||
async execute(client, interaction) {
|
||||
await interaction.deferReply();
|
||||
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 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, {
|
||||
requestedBy: interaction.user,
|
||||
|
@ -75,10 +75,12 @@ class Play extends BaseCommand {
|
|||
});
|
||||
} catch (e) {
|
||||
client.player.deleteQueue(interaction.guildId);
|
||||
interaction.error("music/play:ERR_OCCURRED", {
|
||||
error: e
|
||||
});
|
||||
console.error(e);
|
||||
return interaction.editReply({
|
||||
content: interaction.translate("music/play:ERR_OCCURRED", {
|
||||
error: e
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue