As @Resxt pointed out, you can handle the logic completely from a game script.
If you host a dedicated server you can also use third-party tools like IW4M which can track in their database everything a player said in the chat. You can also make plugins for that tool to do certain actions for every chat message.