2
votes

I am just getting into Discord.JS and wasn't able to find any clues on how to server mute a specific user. I was looking over some documentation but still didn't find an appropriate answer. I do know you can do this by setting roles, but that won't work since the role on the user I will be muting using the bot will have the @everyone role set so they can talk which does override my added role.

More detailed my program will be testing if the user speaks for over 30 seconds and will further mute them for 1 minute. It is made so the bot doesn't need to be in the channel to record who is talking for what amount of time, but I could change that if a server mute needs the bot to be in the same channel.

The Bot has full server privileges.

2
The Muted role should not be overridden by @everyone's permissions, are you sure that's happening?LW001
I am sure of it. I tested it manually by having only servers >everyone role and >mutedByBot role and it allowed me to speak as nothing would change. When i had >admin, >everyone and >mutedByBot role it did the same thing more or less expected. LINKS TO ALL ROLES SPEAKING SETTINGS:mutedByBot; everyone; adminAleksander Piciga
Just checking because if you own the server you automatically have all permissions. Could you try testing your roles on an alternate account?LW001
I do not own the server, but i do have an admin role which allows me to alter things a bit. My friend does own it tho so he did allow my bot to have all permissions.Aleksander Piciga
Well if you have the Administrator permission you also have all permissions so the Muted role wont hurt you eitherLW001

2 Answers

4
votes

I think you missed a step on this.
I just made a Discord Server to test this with 2 accounts to check if this was working.

You will need a role higher than the normal user rule (if any) and then on every channel you'll need to overwrite the default permissions, saying that that role cannot send messages in that channel. (yes you need to do this on every channel) permissions per channel
There are only 2 settings on the permissions on the roles menu. Yes, or get from other roles users might have.
Channels Permissions on the other hand have 3: Yes, No, Get permissions from roles.
If there is any role higher up that the user has, and it has permissions to send messages, this would be overwritten.

Also don't forget that the bot role needs to be higher than the muted one, otherwise the bot cannot assign the role to other users.

0
votes

A little extension to @André's answer, you can do it to each category instead, saves a lot more time. Also, if a person's role has "administrator" privileges, then it'll bypass the muted role restrictions.