Dispatches are how you tell the bot to do something.

import SpawnDispatch from 'yolkbot/dispatch/SpawnDispatch';

bot.dispatch(new SpawnDispatch());

Dispatch Checks

Dispatches will always run a check to see if they can occur. This check just returns true or false.

import SpawnDispatch from 'yolkbot/dispatch/SpawnDispatch';

const spawnDispatch = new SpawnDispatch();

if (spawnDispatch.check(bot)) {
    bot.dispatch(spawnDispatch);
}

If the check is false, the Dispatch will be saved, and the bot will check every tick for the Dispatch to return true. Once it does, the Dispatch will be executed.

Dispatch List

The good part! Here are all of the dispatches:

Each of these has their own file to explain what checks are ran and the function in a deeper form.

In the end, dispatches are fairly simple - check they can run and run them!