RocketChat/Rocket.Chat · error
You_have_been_muted
Error message
You_have_been_muted
What it means
validateRoomMessagePermissionsAsync throws You_have_been_muted (plain Error) when the acting username appears in room.muted — the room-level mute list set by moderators. Unlike read-only (a whole-room state) this silences one user in that room, and the room.unmuted list does not lift it.
Source
Thrown at apps/meteor/server/lib/authorization/canSendMessage.ts:50
if (
await roomCoordinator.getRoomDirectives(room.t).allowMemberAction(room, RoomMemberActions.BLOCK, 'uid' in args ? args.uid : args._id)
) {
const subscription = await Subscriptions.findOneByRoomIdAndUserId(room._id, 'uid' in args ? args.uid : args._id, subscriptionOptions);
if (subscription && (subscription.blocked || subscription.blocker)) {
throw new Error('room_is_blocked');
}
}
if (room.ro === true && !(await hasPermissionAsync('uid' in args ? args.uid : args._id, 'post-readonly', room._id))) {
// Unless the user was manually unmuted
if (args.username && !(room.unmuted || []).includes(args.username)) {
throw new Error("You can't send messages because the room is readonly.");
}
}
if (args.username && room?.muted?.includes(args.username)) {
throw new Error('You_have_been_muted');
}
}
// TODO: remove option uid and username and type
export async function canSendMessageAsync(
rid: IRoom['_id'],
user: { uid: IUser['_id']; username: IUser['username']; type: IUser['type'] } | IUser,
extraData?: Record<string, any>,
): Promise<IRoom> {
const room = await Rooms.findOneById(rid);
if (!room) {
throw new Error('error-invalid-room');
}
await validateRoomMessagePermissionsAsync(room, user, extraData);
return room;
}
View on GitHub (pinned to b2c16d5842)
Solutions
- A moderator unmutes the user (removes the username from room.muted)
- Before sending programmatically, check room.muted for the acting username and surface a 'muted in this channel' state
- Prefer time-boxed muting over permanent mutes for temporary silencing
Defensive patterns
Strategy: validation
Validate before calling
if (room.muted?.includes(username)) {
// show 'you are muted in this channel' and block the send locally
} Type guard
const isMutedInRoom = (room: { muted?: string[] }, username: string): boolean =>
room.muted?.includes(username) === true; Try / catch
try {
await sendMessage(...);
} catch (e) {
if (e instanceof Error && e.message === 'You_have_been_muted') {
// muted by moderation: no retry; surface muted state in the composer
}
throw e;
} Prevention
- Reflect room.muted in the client composer state
- Use time-boxed mutes for temporary silence instead of permanent ones
- Review mute lists during channel moderation audits
When it happens
Trigger: A muted user (or an integration acting as them) sends any message to the room where a moderator muted them via the user card or moderation tools.
Common situations: Moderators mute spammers and the spam client keeps posting; users muted during town-hall meetings; a stale mute list nobody remembers to clear.
Related errors
- You can't delete messages because the room is readonly.
- room_is_archived
- You can't send messages because the room is readonly.
- Not allowed
- error-action-not-allowed
AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18).
Data as JSON: /api/errors/60882c846ea04b45.
Report an issue: GitHub.