Handle chat messages and commands