- What's your exact discord.js
npm list discord.jsand nodenode -vversion? - Not a discord.js issue? Check out #1081585952654360687.
- 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!
#TypeError: Cannot read properties of undefined (reading 'hasPermission')
19 messages · Page 1 of 1 (latest)
@steady furnace did you accidentally open a post or?
I realized this was question and not support
I was gonna post it in #djs-help-v14
this is a support channel
oh well
I keep getting this error as shown above and here's my code:
async execute(message) {
if (message.member.guild.me.hasPermission("ADMINISTRATOR"))
return message.channel.send("You can ban people!")```
it’s permissions.has(…)
hasPermission was v12 and we don’t support 12 or 13
Ah okay
in v14, it’s <Guild>.members.me.permissions.has('Administrator')
So something like this?
Guild.members.me.permissions.has("ADMINISTRATOR")
Forgive me I am very fresh to JS, and I dunno what you mean by <Guild>
Explaining <Class> and Class#method notation: learn more
ty
i suggest you learn javascript before making a discord bot
I have a very basic understanding of JS, I am just new to it still and it gets confusing.