Distube

client.on('messageCreate', async message => {
if (message.author.bot || !message.guild) return
if (!message.content.startsWith(prefix)) return
const args = message.content.slice(prefix.length).trim().split(/ +/g)
if (message.content.startsWith(prefix + "play")) {
if (!message.member.voice.channel) return message.reply({ content: `> **عذراً ، يجب ان تكون داخل روم صوتي لتستخدم هذا الأمر**` })
try {
const string = args.join(' ')
if (!string) return message.channel.send(`${client.emotes.error} | Please enter a song url or query to search.`)
client.distube.play(message.member.voice.channel, string, {
member: message.member,
textChannel: message.channel,
message
})
}
catch (e) {
console.error(e)
message.channel.send(`حدث خطا اثناء التشغيل !`)
}
}

client.on('messageCreate', async message => {
if (message.author.bot || !message.guild) return
if (!message.content.startsWith(prefix)) return
const args = message.content.slice(prefix.length).trim().split(/ +/g)
if (message.content.startsWith(prefix + "play")) {
if (!message.member.voice.channel) return message.reply({ content: `> **عذراً ، يجب ان تكون داخل روم صوتي لتستخدم هذا الأمر**` })
try {
const string = args.join(' ')
if (!string) return message.channel.send(`${client.emotes.error} | Please enter a song url or query to search.`)
client.distube.play(message.member.voice.channel, string, {
member: message.member,
textChannel: message.channel,
message
})
}
catch (e) {
console.error(e)
message.channel.send(`حدث خطا اثناء التشغيل !`)
}
}

hey i want extract from this code !join and play like !join 'bot' or !setbot 'channel' 'bot' and !play , if bot in channel
2 Replies
d.js toolkit
d.js toolkit5mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by staff
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server