These days, the closest thing to "documentation" remaining would be the
source of the blocks here.
In brief, though, when the Chat Box detects a player using chat, it'll generate an
event which can be pulled like so:
local event, chatBoxSide, playerName, message = os.pullEvent("chat_message")
If a player starts their chat message with ##, then only chat boxes will "see" it (you get a "chatbox_command" event instead of a "chat_message" event). Certain other happenings - such as player deaths - also generate events; I like to use this basic loop to give me information about events I'm unfamiliar with:
while true do print(os.pullEvent()) end
Chat boxes can be made to speak by
wrapping them and then calling their "say" function:
local myChatBox = peripheral.wrap(chatBoxSide)
myChatBox.say("Hello world")
If you want to use private messages, use "tell":
myChatBox.tell("NegativeVoltage", "Hello")
It's fairly simple, but I've also got
this example script that I wrote for use with
this API.
Keep
peripheral.getMethods() in mind for finding more functions.
There are also "admin" chatboxes available only in the creative inventory. Regular ones are range-limited, subject to the MoarPeripherals config file; admin ones aren't, and if memory serves, they can even generate events letting you know when players join/leave the server.