Update bot.php
Added tag name converter & cleaned up code