This fixes https://www.smogon.com/forums/threads/bug-reports-v4-read-original-post-before-posting.3663703/post-8710045. This changes /modjoin sync so that (if there's no modchat set) instead of looking for the lowest staff group (in order to set modchat), it looks for the lowest (non reg/whitelist) group that the user can set it to instead. Previously, it looked for the lowest group with the mute permission - bot, which regular users cannot set modchat to in battles.
Currently, staff can turn modchat off, even if the rank is above them. According to both Zod and Aeo, this should never happen, so this fix is very direct for a reason. (this happens because modchat is set to 'a' in config.groups, but we aren't changing that since it may have more side effects. This is clearer, anyway.)
Most current use-cases should be using /hidenext.
The long-form /inviteonlynext is still available for anyone who really
wants it, but in theory it doesn't offer any benefits.
This introduces a new function, `setParent`, to handle the details
of setting up subrooms.
`roomid`, `parent`, and `subRooms` are now read-only, so they can't
be accidentally be set directly rather than through their setters
(`rename`, `setParent`, and `clearSubRooms`).
I don't think setters should be used for this, because I think it's
important to be clear that `rename` and `setParent` will change a lot
of other state and induce network activity.
* Lint arrow-body-style
* Lint prefer-object-spread
Object spread is faster _and_ more readable.
This also fixes a few unnecessary object clones.
* Enable no-parameter-properties
This isn't currently used, but this makes clear that it shouldn't be.
* Refactor more Promises to async/await
* Remove unnecessary code from getDataMoveHTML etc
* Lint prefer-string-starts-ends-with
* Stop using no-undef
According to the typescript-eslint FAQ, this is redundant with
TypeScript, and they're not wrong. This will save us from needing to
specify globals in two different places which will be nice.