Channel permissions
So I have a bot that changes a bunch of people's permission for a channel. However, I am getting the following
DiscordAPIError[50013]: Missing Permissions
However the bot does have permissions (unless it's a person higher than them)
Could it be because it's trying to edit someone's permission that is higher than the bot?
```15 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.Could it be because it's editing someone's permission that is higher than the bot?
Ah
Hold on I'll check the code then
Okay I confirmed myself. When the bot has admin perms it works.
When the bot has the following perms:
["ManageChannels", "SendMessages", "AttachFiles", "ViewChannel", "ReadMessageHistory", "EmbedLinks", "AddReactions"]
For that channel, it will fail to edit the perms later on
Okay, I added that. Now it's giving me the same error upon creating the channel. Previously, the channel would be created and have errors when it would edit the perms later. Now it just errors when creating the channel.
SureError
The only thing I'd guess is coz the bot doesn't have manage perms / manage roles in the category the bot is trying to create. However, I've ensured that the bot has the manage perms permission enabled in the category the bots trying to create the channel in
According to the admins of the server, they have given every permission for the bot in the category it's trying to create, so I'd assume yes (it also has ManageChannels as it's role permission)
Bruh i forgot to turn off the pings mb
Yes, and I do have 2FA (since I am the bot owner)
Ah, I think this is the problem
The only thing that would confuse me now is if the bot has admin, it works perfectly
And yes the owner does play that time (when the bot has admin)
Permissions the bot has in general (their role)
Permissions the bot has in this category:
Bumping this. Anyone?
Can anyone help me solve this issue please? I really don't know what I'm doing wrong here
Have you tried it in a separate test server?
Well I'd try creating a channel without assigning the user permissions. See if that works or not.
Then set user permissions to the channel and see what's causing the error. It maybe that the bot is trying to set a channel permission that it, itself does not have
I tried it in my test server but the bot has admin there and it works
I've confirmed, it's the permissions that's causing the issue
Especially since I added ManageRoles to the client
The permissions as in the player's permissions?
Or do you mean the bot?
Okay I'll summarize what happened
Because your bot is creating a channel AND setting player permissions
This is the flow.
1. Bot creates a channel, and creates user permissions at the same time
2. After about 45 sec to 1 min it's suppose to edit the perms based on whatever action happened.
- What happened at first (approach 1):
When I create the channel, I give the bot the following permissions:
This successfully creates the channel and permissions. However when I edit the permissions later (step 2), I get an error saying
Missing Permissions
- I changed the initial permissions (approach 2):
The permissions the client has when creating the channel is the same. It just has an additional permission which is ManageRoles
. However the bot fails to create the channel giving the error Missing Permissions
. This has something to do with setting the user perms.Ok so just to clarify the bot crashes when you set ManageRoles permission on the user or the bot itself?
Bot itself
These are the list of permissions the bot has in general and in the category it's trying to create the channel in
Yeah I couldn't say
Sorry
It's okay