Many people have said to use message.member.guild.me.hasPermission("PERMISSION") {
to check if the bot has a permission. It used to work, but for some reason it stopped working which is really confusing to me because I am a new coder.
Edit – Here is my full code for more context:
module.exports = {
name: "help",
description: "Displays an embed with all the commands of the bot.",
execute(client, message, args, Discord, msgAuthor) {
const channel = message;
if (message.member.guild.me.hasPermission("EMBED_LINKS" || "ADMINISTRATOR")) {
if (!args[0]) {
const newEmbed = new Discord.MessageEmbed()
.setColor('000000')
.setTitle('Esando Bot commands')
.setDescription('Remember to use the prefix at the start of any command!')
.addFields(
{ name: 'help music', value: "Displays an embed for help regarding music." },
{ name: 'invite', value: "Sends the invite link to the Esando Community server." },
{ name: 'kick [@member]', value: 'Kicks a specified member from the server.' },
{ name: 'ban [@member]', value: 'Bans a specified member from the server.' },
{ name: 'slowmode [seconds]', value: "Sets the channels slowmode cooldown. You can use 'slowmode off' to turn off slowmode." },
)
.setFooter("Esando Bot", "https://cdn.discordapp.com/attachments/786845863787626517/791421970200657940/bot3.png")
message.channel.send(newEmbed);
} else if (args[0] == 'music') {
const newEmbed = new Discord.MessageEmbed()
.setColor('000000')
.setTitle('Esando Bot music commands')
.setDescription('Remember to use the prefix at the start of any command!')
.addFields(
{ name: 'play ', value: "Searches YouTube for that video and plays the first search result as audio. (You can also use URL's)" },
{ name: 'leave', value: "Disconnects the bot from the voice channel (you must be in the same voice channel to execute this command)." },
)
.setFooter("Esando Bot", "https://cdn.discordapp.com/attachments/786845863787626517/791421970200657940/bot3.png")
message.channel.send(newEmbed);
}
} else {
message.channel.send(`${msgAuthor} I don't have sufficient permissions to send embeds in ${channel}! To change this, make sure me or my role have the 'Embed Links' permission for this channel.`);
}
}
}
You are looking for
message.member.guild
while the correct syntax would bemessage.guild.member
tadalafil buy – http://xtadalafilp.com/ tadalafil generic online
Khnjjp – ivermectin 0.08 Gtlmlg bkbwsl
Yzgqib – buy cialis online Odoerc cijtuj
Cojzei – furosempi.com Pxtpss plgdba
Lqnlof – generic zithromax Mevcds jauqvh
Swrtov – how much is a cialis prescription Zozory ofnkzj
Mdqsdn – canadian pharmacy generic viagra Akcwfn rqxjxp
Dqpiju – essayonlinestore Ciktyc jukjax
Qmfdip – buy brand name viagra Ylvrdu pgpbxv
Xqvkqe – hrm dissertation Jysprg iueskg
Omakin – finasteride 1mg online purchase Yziuwm lkthak
Cyynqy – viagra 50 mg forum Wuuyoh ftarbn
Wzqokr – buy propecia pills Gduzld dphvvt
Aejytf – writing a good persuasive essay Ondeud tibuiq
Hqdzib – sildenafil purchase Txktpk orbxfj
Lyuecf – 3 page research paper Jxirdm vfylam
Dksool – furosemidelasixx.com Avojfe inehne
Rzqkcf – purchase vardenafil online Gcancm ibnqay
Jzqfeu – silagra 100 mg india Jgodsv pzsgtd
Pbzdtm – silagra 0785 Kmtqsp rwcbzb
Usharx – tadacip Cbekom fdtybo
Pdvove – generic stendra Fijgyq tasmdx
tadacip 20 india – order tadacip 20 mg tadacip cipla
celebrex over the counter canada – where can i buy celebrex 100 mg tablets celebrex india