// import github.com/Diarkis/dairkis/server, github.com/Diarkis/diarkis/room github.com/Diarkis/diarkis/util// This exposes all room commandsroom.ExposeCommands()// This exposes all room support commands including text chatroomSupport.ExposeCommands()// Make sure you write this block of code AFTER calling room.ExposeCommands() and roomSupport.ExposeCommands()// By doing so, we make sure sendTextChatData function is executed after the text chat is handledserver.HandleCommand(util.CmdBuiltInVer, util.CmdRoomChatSync, sendTextChatData)// This function handles the sending of incoming text chat messagefuncsendTextChatData(ver uint8, cmd uint16, payload []byte, userData *user.User, next func(error)) {iflen(payload) ==0 {// Empty data, ignore itnext(nil)return } textChatData :=string(payload)// Send textChatData somewhere else here!next(nil)}