var myConvHandler = function myConvHandler(command, player, message, conversation) {
// command = first word in the message (string)
// player = id of player who sent the command (number)
// message = array of words in chat message (message[0] == command)
// conversation = conversation object associated with player
// do some stuff
// if you want a message sent to the player,
// return a string or an array of strings
return "done";
}
extendConversation(4); // give player 15 seconds to send their reply
Notes
If there is an active Conversation with the player, commands will be ignored and all chat messages from the player will be sent to the conversation handler instead.
Conversations will automatically expire if the player doesn't reply within a set amount of time (default: 15 seconds). You can stop a conversation at any time using chat.stop(). When a conversation ends, chat message handling will be returned to the command interface.