[#377] Resolve "BUG: properly handle out-of-context no-payload commands"
Closes #377 (closed)
changes
add execute#interveneIfBadMessage
:
- called at top of
execute#execute
before any command handling logic runs - if it encounters a no-payload command or an admin-only command from a subscriber or rando it returns early (with a hotline message if hotline enabled for channel, or a generic error message if not)
- also returns early with any parse errors (which catches the case of an admin neglecting to use broadcast)
- if neither applies, passes control to rest of
#execute
logic - shares logic for how to handle incoherent subscriber messages with
execute#handleNoCommand
, extracts this as a new helper,execute#handleIncoherentSubscriberMessage
modify messages.parseErrors.unnecessaryPayload
to prompt user to use BROADCAST
(which is safe b/c now we only ever show this error to admins!)
Edited by aguestuser