This command should never be used by users.
This is for scripting, like buttons, like:
<button name="send" value="/nofeedback /ionext">
so they don't spam your PMs.
Global punishments like /lock will notify Staff, and admin commands
like /updateserver will log to Staff, but this has been done ad-hoc
in the past.
To handle these cases, this commit introduces new chat-context
functions:
- `this.addGlobalModAction`,
- `this.privateGlobalModAction`
- `this.stafflog`
Other updates:
- the issue where Staff notifications didn't show up until someone talks
has been fixed
- `privateModAction`s in Staff will now be visible in the scrollback
log
- a bunch of commands that should notify Staff but didn't now do
- some typos in modlogs have been fixed
NOTE: This is changes the semantics of `hidenext`/`ionext` from
applying to the next created *battle* to applying to the next
created *search*/*challenge*.
The idea is that throwing `ErrorMessage` will replace needing to pass
`context` variables around (which make it hard to unit test a lot of
chat functions).
I recognize the drawback is that it makes it harder to tell where
chat commands might return from. This might be somewhat alleviated by
a convention such as prefixing everything with `check`
this.checkBroadcastable();
this.checkCan('lock');
I honestly didn't like the old approach of `if (!this.can(...)) return`,
though. It didn't seem very obvious which commands would show error
messages and which needed you to write your own error messages. I think
the new system would at least be clearer about that.
We can also consider things such as some sort of sigil, such as:
!this.checkCan('lock');
There's no other reason to use `!` at the beginning of a line, so I
think this is reasonably unambiguous, although it might take some
time to learn. Also we'd have to screw with eslint.
Another alternative is something all-caps?
this.CHECK_can('lock');
In the end, I still think `this.checkCan('lock')` would be enough, and
I still think it's already an improvement in many ways.