I need a little TCL script


The following thing:
There is a Bot1. Bot1 says something like. "A". Then later "B" and "C" etc.
Now I need Bot2 (with that NEW SCRIPT here) this Bot2 must now log everything what Bot1 says and put this into a temporary .dat file (store the messages from Bot1) and then I need a command like !todaymessages and Bot2 will put out everything what Bot1 said "today"! (the script must reset after 0.0am).
Anyone knows how to do this? Thanks!