How to handler chat bar for some function

I want to add a chat function that can let player chat without type / to chat
Does someone have some code snippest for me?