From a86bd3bbd7488fd2bf35689ed7e532dfa3e6ec98 Mon Sep 17 00:00:00 2001 From: Mia <49593536+mia-pi-git@users.noreply.github.com> Date: Fri, 29 Apr 2022 19:01:57 -0500 Subject: [PATCH] Chat: Inform locked users to use / commands when broadcasting --- server/chat.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/chat.ts b/server/chat.ts index cb7ba7c797..50cf1dc779 100644 --- a/server/chat.ts +++ b/server/chat.ts @@ -1011,6 +1011,11 @@ export class CommandContext extends MessageContext { return true; } + if (this.user.locked && !(this.room?.roomid.startsWith('help-') || this.pmTarget?.can('lock'))) { + this.errorReply(`You cannot broadcast this command's information while locked.`); + throw new Chat.ErrorMessage(`To see it for yourself, use: /${this.message.slice(1)}`); + } + if (this.room && !this.user.can('show', null, this.room)) { this.errorReply(`You need to be voiced to broadcast this command's information.`); throw new Chat.ErrorMessage(`To see it for yourself, use: /${this.message.slice(1)}`);