Chat: Inform locked users to use / commands when broadcasting

This commit is contained in:
Mia 2022-04-29 19:01:57 -05:00
parent 8ef8765a87
commit a86bd3bbd7

View File

@ -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)}`);