- Rewrote Commands API with the following changes:
◦ `registerCommand` takes a command object arg, which consists of `command` (string), `executor` (function), `caller` (this is set automatically), and
optionally `aliases` (array of strings), `icon` (icon name or image URL), `description` (string), `source` (string), `showTyping` (boolean);
emits `Events.VIZALITY_COMMAND_ADD` (`commandAdd`)
◦ `unregisterCommandsByCaller` takes one string argument of an addon ID, unregisters all commands registered by an addon;
emits `Events.VIZALITY_COMMAND_REMOVE_ALL_BY_CALLER` (`commandRemoveAllByCaller`)
◦ `unregisterAllCommands` takes no arguments, unregisters all commands; emits `Events.VIZALITY_COMMAND_REMOVE_ALL` (`commandRemoveAll`)
◦ `unregisterCommand` now emits `Events.VIZALITY_COMMAND_REMOVE` (`commandRemove`)
◦ `invokeCommand` programmatically executes a command; now emits `Events.VIZALITY_COMMAND_INVOKE` (`commandInvoke`)
◦ `getCommand` takes one filter function argument, gets the first command found by a given filter
◦ `getCommandByName` takes one string argument of a command name, gets a command by a given name
◦ `getCommands` takes one filter function argument, gets all commands found by a given filter
◦ `getCommandsByCaller` takes one string argument of an addon ID, gets all commands registered by an addon
◦ `getAllCommands` takes no arguments, gets all commands
◦ `isCommand` takes one string argument of a command name, returns a boolean of whether an action is registered or not
◦ `commands` object is now an array of command objects and is no longer exposed, and you must use one of the `get` functions above to retrieve them
◦ `find`, `filter`, `map`, and `sort` methods have been removed
- Rewrote Actions API with the following changes:
◦ `registerAction` takes an action object arg, which consists of `executor` (function) and `action` (string); emits `Events.VIZALITY_ACTION_ADD` (`actionAdd`)
◦ `unregisterActionsByCaller` takes one string argument of an addon ID, unregisters all actions registered by an addon;
emits `Events.VIZALITY_ACTION_REMOVE_ALL_BY_CALLER` (`actionRemoveAllByCaller`)
◦ `unregisterAllActions` takes no arguments, unregisters all actions; emits `Events.VIZALITY_ACTION_REMOVE_ALL` (`actionRemoveAll`)
◦ `unregisterAction` now emits `Events.VIZALITY_ACTION_REMOVE` (`actionRemove`)
◦ `invokeAction` now emits `Events.VIZALITY_ACTION_INVOKE` (`actionInvoke`)
◦ `getAction` takes one filter function argument, gets the first action found by a given filter
◦ `getActionByName` takes one string argument of an action name, gets an action by a given name
◦ `getActions` takes one filter function argument, gets all actions found by a given filter
◦ `getActionsByCaller` takes one string argument of an addon ID, gets all actions registered by an addon
◦ `getAllActions` takes no arguments, gets all actions
◦ `isAction` takes one string argument of an action name, returns a boolean of whether an action is registered or not
- `toRGB` and `toHSL` color util methods renamed to `toRgb` and `toHsl` respectively
- `setCSSCustomProperty` and `getCSSCustomProperty` dom util methods renamed to `setCssCustomProperty` and `getCssCustomProperty` respectively
- `removeEmptyProperties` object util method renamed to
`removeUndefinedProperties`
- `chunk` string util method renamed to `chunkText`
- `owoify` string util method renamed to `owoifyText`
- Wrapped all methods in try...catches
- Now takes a single object argument, and allows for potentially unlimited labels and a customizable badge icon
- Methods now take the form of: `log({ labels: [ 'cake', 'pie' ], message: 'I really like pie' })` In this example, it will create a log message with 2 labels, cake and pie, both with random colors. You can also define your own colors by using an array of objects for `labels`, which include `text` and `color` properties like:
```
log({
labels: [
{ text: 'i like pie', color: '#ff0000' },
{ text: 'hehe', color: '#ffffff' }
],
message: 'I really like pie'
})
```