Skip to Content

This server export registers a named chat mode, such as an admin channel, with its own display name, color, and ACE requirement. The mode’s cb callback runs whenever a message is sent in that mode.

Export Name

registerMode

Parameters

  • object modeData: { name, displayName, color, seObject, cb }
    • name: Internal mode identifier
    • displayName: Name shown in the chat UI
    • color: CSS color string for the mode
    • seObject: ACE permission required to use the mode
    • cb: function(source, message, cbs) called when a message is sent in this mode

Example

exports.chat:registerMode({ name = 'adminChat', displayName = 'Admin', color = '#fca503', seObject = 'admin.chat', cb = function(source, message, cbs) cbs.updateMessage({ template = '[ADMIN] {}' }) cbs.setSeObject('admin.chat') end })