bot perms
anyone knows why is this not working?
i don't have a handler, its on the start of the code right above the commands
i have this in client "PermissionsBitField"
and other regular perms in commands work, for example
this works, and thats why i can't understand why the first line isn't working, they are in the same file and everything
the exact error is
TypeError: Cannot read properties of undefined (reading 'permissions')
8 Replies
- 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!that'd be because
<Guild>.me
was moved to <Guild>.members.me
, therefore <Guild>.me
is undefined
if you haven't already, consider checking out the v14 update guide
https://discordjs.guide/additional-info/changes-in-v14
so i switched it to this, now there is not an error message but the bot continues working even if it doesn't have the perms, and i confirm it by trying to use an embed it just shows an error in the console, commands with no embed work and it doesn't send the reply it should send
is it possible this would be due to permission overwrites?
if you were looking to check their perms specifically for the given channel, you could use
<GuildChannel>.permissionsFor()
or <GuildMember>.permissionsIn()
GuildChannel#permissionsFor()
Gets the overall set of permissions for a member or role in this channel, taking into account channel overwrites.
like in general, to prevent the errors while sending embeds
should i put like message.guild.members.me.message.channel.permissionsFor() ?
or message.channel.members
well
<GuildMember>.message
doesn't exist
<Message>.channel.permissionsFor()
exists
not exactly sure what <Message>.channel.members
has to do with thisim trying to check if the bot has embed perms
any1 knows how to do that???