ripped code from default bot