Chat improvements: modding, command handling, and bugfixes
Looking for feedback, changes summarized below.
Closes #330 (closed):
Reworked commands system and social component: No more extending socialCommands on to social component, it uses a new file, misc/commands.js
.
Added modding for commands: Uses the events onBeforeGetCommands
and onBeforeGetLocalCommands
Load commands from config: Loads from config/commands.js
, which loads from config/commands/individualCommandFiles
New command running context: Command handlers get the object running the command and a context with the command arguments, original message, parsed config (for getItem/setStat etc).
Tested with all the commands EXCEPT for setStat (see #980), get/lose reputation (crashing in the reputation component, need to test if it happens on v0.3.1 without my changes), and setPassword (don't know how to hash the passwords correctly). Other than that, I ported all the commands to the new system and they all work.
Example mod for adding a local command and sending output to the player: https://gitlab.com/snippets/1773518
Closes #456 (closed):
Commands no longer send as /asdf
if they are invalid, instead it fails and sends an error message.
Closes #978 (moved):
An error shows when you try to mute someone with a higher permission level.
Closes #977:
/blocklist
shows who you have blocked.