rmx
21
This should be the rough layout of ur if statement
if (command === “çal” || command === “p” || command === “play”) {
const voiceChannel = msg.member.voiceChannel;
if (!voiceChannel) {
const embed = new Discord.MessageEmbed()
.setColor("#000000")
.setDescription(“":loud_sound: **Bir sesli kanalda olman lazım.** ")
return msg.channel.send(embed)
}
// other music code
}
1 Like
Yonle
22
I see… That’s MusicBot command… Try this one:
if (command === “çal” || command === “p” || command === “play”) {
const voiceChannel = msg.member.voice.channel;
//Now, discord.js v12 using message.member.voice.channel
if (!voiceChannel) {
const embed = new Discord.MessageEmbed()
.setColor("#000000")
.setDescription(“":loud_sound: **Bir sesli kanalda olman lazım.** ")
return msg.channel.send(embed)
}
Where you put
const embed = new Discord.MessageEmbed()
replace it with
new Discord.MessageEmbed()
Or define the MessageEmbed before the send function.
Yonle
24
It looks like you’re new of coding.
I suggest you to learn JavaScript first, Then continue to NodeJS.
1 Like
Yeah, you’re very new to the NodeJS language. Please begin with JS first and then move on to NodeJS.
Also, for the sake of helping you through, please, at the top, put this string.
const { MessageEmbed } = require(‘discord.js’)
Wherever you want an embed, please put this string:
const = new MessageEmbed():
And then just .setTitle your new message(MAKE SURE YOU INDENT)
and then .setDescription whatever.
Best wishes,
Codex10
2 Likes
system
Closed
26
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.