This is already implemented in Smogon if they don't hide their activity. The /whois command in showdown will tell you if they are online or not.
I've noticed that this is a Pokemon Showdown suggestion. Please, in the future, use its suggestions thread found above the title of this thread.