How can I keep track of how long there is no public activity in a channel and store that value in a variable.

Ex. If no one says anything in #bots-r-us for one hour then have the bot say something.