This question already has an answer here:
Is it possible to make a command block respond to something being said in the chat? Or even better - make it respond to a message - /msg or /tell. I want to say something in the chat and then a comparator next to the block emits a redstone signal. Is this possible?