You might be a bit concerned about this question, well, I'll explain it!
I want a command block to be searching for anyone saying
.clearchat and if it comes out true it will clear chat. Is it really possible(?), and if it is leave an answer below!
It is not possible for a command block to clear chat however, Building on @aeldrion’s answer, you can clear the chat for yourself by pressing
D. Depending on your keyboard preferences on providing function keys, you may also have to press
FN as well for it to work. I’m sorry your objective was not possible and I hope this trick will help you to work around it.