Channel permission check
so i am trying to find if bot have permission to send message in channel or not, i using this code
also i have this options enable
15 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!And what's the problem?
if statement is returning false but bot dont have any permission
It should return false if it doesn't have the permission according to the code you showed
I don't see the problem
idk why it returning true either that why i created the post
am i missing something?
You can always log
permissionsIn().serialize()
and look at the permissions it listsSo it has the permission, but it is still returning the message saying it doesn't have it?
dham when i check the json it said ViewChannel false
no wonder it throwing error
hahahaha
There's that too, good catch, but I didn't think it'd cause that behavior
well bot was crashing and throwing error
rawError: { message: 'Missing Access', code: 50001 },
code: 50001,
status: 403,
method: 'POST',
That is usually helpful to include when asking for help
Because that would have pointed me in a different direction from the start
sorry my bad
thanx for the help
Now you know for next time 🙃
Hope your project turns out well!
thanx