replaces global variable with bot.memory dict
removes thread interval from config
adds try statements to avoid uncontrolled behavior