Fixed onMode event.
Removed unused imports.
Might use TCP to change bot configuration via website.