CHAT_COMMAND

This is called when the logged in user types a chat command starting with forward slash '/' that is not handled natively by plug.dj. This allows you to run your own chat commands. It passes the entire chat string including the forward slash.

EXAMPLE DATA

"/move @Burkes 1"

USAGE

API.on(API.CHAT_COMMAND, data => { 
    console.log(data);
});

Comments

  • Avatar
    LegitSoulja

    What if i wanted to get the args of the command. like /shout hey
    How could i get the callback of 'hey'? Do i have to do more coding and split the callback and etc?

  • Avatar
    LegitSoulja

    My theory

    var args = value.split(" ");

    args[0] is the command - /shout
    args[1] is the args1; - hey

  • Avatar
    MIxxx

    would be nice if this worked when any user that was logged in issued a chat command in the room

  • Avatar
    Bob Flemington

    It would also be nice if this was passed when you type /help.

Powered by Zendesk