Move some bot functions to the bot directive