Trying to change a channel name only works when my bot gets the admin role.
I've got some simple DiscordJS code that is trying to set the name of a specific channel.
The problem is that this only succeeds when i assign the bot the Administrator role.
From what I read in the manual, having the Manage Channel role should be sufficient, but that doesn't seem to be the case.
I made sure that the bot has server-wide MANAGE_CHANNEL rights, I have added the MANAGE_CHANNEL permission to the bot Role itself, and added it to both the channel category as well as the channel.
But I keep getting DiscordAPIError[50001]: Missing Access
Am I wrong in thinking that the MANAGE_CHANNELS permission is enough ?
27 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!Screenshots of said permissions
If Discord is denying it then yeah, in this situation it isnt enough. e.g, something like having Manage Channel but not View Channel
Well, i have given it all of the channel permissions i could think of
The strange thing is that my own user, which DOESN'T have the administrator permission, is able to create channels and change their names.
Which doesn't quite make sense to me
mind showing your code?
Sure, it's pretty simple
It works fine when the bot has administrator permissions
Its unlikely to be code related, just something in the permissions hierarchy
e.g., being blocked at the category level
Discord API only mentions the MANAGE_CHANNELS permission
But if you look at the screenshots higher up, it seems like it has all permissions on all levels
But i suppose there must be some kind of strange setting there that still disallows it somehow
Its the API disagreeing with you, not discord.js. There's very little we can do, youd be better off checking with Discord API or Discord Developers
I suppose you're right
I agree, it all looks right from what youve shown
I'll look into what permissions it detects with discordjs for said bot.
The config looks allright, so i must be doing something wrong that I think I'm doing right 😄
After 20+ years of dev work that still happens on a weekly basis 😄
so, i ran your code with a freshly created bot and added to guild using those permissions:
everything works completely fine
hmmm
weird
didnt even change perms for channel and role
thanks for that
ill do some testing rn and tell u in which cases it doesnt work
i got the same error when:
1. added bot with
View Channels
and Manage Channels
perms on server
2. created new text channel under private category with permissions syncing, where perm View Channel
was denied for @everyone
3. tried to modify that channel
so simply, bot doesnt has access to that channelwell if i ask for the permissions, it says
Both on the server as for the specific channel
i gave the role those perms in private category and it seems to be working again
*i have enabled permission syncing for channels inside of that category
check permissions for role in server settings
and simply double check channel id and other info
I did this:
and that gave the same permissions as on the channel itself
anyway, i'll do some more testing, see if I can find anything wrong. Just weird that its acting this way
Yeah, ok so definitely something fishy with the permissions on some level.
Just added a new. pristine channel, and I could just change its name
Thanks @clownidze to check with me.
yeah, that permissions thing without administrator is hell to set up correctly
:blobguns:
OK, so it works once I clicked the sync permission thingy on the category
I also gave View Channels to @ everyone
@oenieke @clownidze Permissions in Discord are sometimes implicitly denied or allowed based on logical use. For voice and stage channels, denying the
CONNECT
permission also implicitly denies other permissions such as MANAGE_CHANNEL
. Turning a Voice Channel private automatically denies both VIEW_CHANNEL
and CONNECT
permissions on that channel thus inadvertently also stopping a non administrator from managing it.
This specific behavior is mention in Discord's Developer Documentation under the section Implicit PermissionsThanks for the info !