factoring out a bot-command? utility function