.Mn
.Mn
DIAdiscord.js - Imagine an app
Created by .Mn on 9/23/2023 in #djs-questions
voice problem
no error but it didn't play the song !
else if (args[0] === prefix + "play" || args[0] === prefix + "p" || args[0] === prefix + "شغل") {
if (!message.member.voice.channelId) return message.reply({ content: `:no_entry_sign: You must join a voice channel to use that!` }).then(msg => { bot_messages.set(message.id, msg); setTimeout(() => bot_messages.delete(message.id), 1800000) });
let client_m = message.guild.members.me;
if (client_m.voice.channelId && message.member.voice.channelId !== client_m.voice.channelId) return message.reply({ content: `:no_entry_sign: You must be listening in **${client_m.voice.channel.name}** to use that!` }).then(msg => { bot_messages.set(message.id, msg); setTimeout(() => bot_messages.delete(message.id), 1800000) });
let song = args.slice(1).join(" ");
if (!song) return message.reply({ content: `❌ Please provide song url or name to play.` }).then(msg => { bot_messages.set(message.id, msg); setTimeout(() => bot_messages.delete(message.id), 1800000) });
if (song.split(" ")[0].includes("soundcloud.com") && song.split(" ")[0].includes("http")) {
song = await getWebSoundCloudURL(song.split(" ")[0]);
}
await music_client.distube.play(message.member.voice.channel, song, {
member: message.member,
message,
textChannel: message.channel
}).catch(() => {
message.reply({ content: `**🔍 Not found.**` }).then(msg => { bot_messages.set(message.id, msg); setTimeout(() => bot_messages.delete(message.id), 1800000) });
});
let queue = music_client.distube.getQueue(message);
if (queue) {
let data = await music_db.get(music_client.user.id);
if (!data) {
data = defaultData;
}
try {
queue.setVolume(data.volume);
queue.setRepeatMode(data.repeat ? 1 : 0);
} catch {}
}
}
else if (args[0] === prefix + "play" || args[0] === prefix + "p" || args[0] === prefix + "شغل") {
if (!message.member.voice.channelId) return message.reply({ content: `:no_entry_sign: You must join a voice channel to use that!` }).then(msg => { bot_messages.set(message.id, msg); setTimeout(() => bot_messages.delete(message.id), 1800000) });
let client_m = message.guild.members.me;
if (client_m.voice.channelId && message.member.voice.channelId !== client_m.voice.channelId) return message.reply({ content: `:no_entry_sign: You must be listening in **${client_m.voice.channel.name}** to use that!` }).then(msg => { bot_messages.set(message.id, msg); setTimeout(() => bot_messages.delete(message.id), 1800000) });
let song = args.slice(1).join(" ");
if (!song) return message.reply({ content: `❌ Please provide song url or name to play.` }).then(msg => { bot_messages.set(message.id, msg); setTimeout(() => bot_messages.delete(message.id), 1800000) });
if (song.split(" ")[0].includes("soundcloud.com") && song.split(" ")[0].includes("http")) {
song = await getWebSoundCloudURL(song.split(" ")[0]);
}
await music_client.distube.play(message.member.voice.channel, song, {
member: message.member,
message,
textChannel: message.channel
}).catch(() => {
message.reply({ content: `**🔍 Not found.**` }).then(msg => { bot_messages.set(message.id, msg); setTimeout(() => bot_messages.delete(message.id), 1800000) });
});
let queue = music_client.distube.getQueue(message);
if (queue) {
let data = await music_db.get(music_client.user.id);
if (!data) {
data = defaultData;
}
try {
queue.setVolume(data.volume);
queue.setRepeatMode(data.repeat ? 1 : 0);
} catch {}
}
}
3 replies
DIAdiscord.js - Imagine an app
Created by .Mn on 7/31/2023 in #djs-questions
i'm using slash commands and it do not work for me on a my server, but on another server it work wit
-
76 replies