Skip to main content
Version: Current

Mod Actions

  • applyMod(bot: any, ...mods: Mod[]): void

    Applies the given mods to the given bot.

    The first parameter is a any and is the bot thatthe mods should be applied to.

    Each other parameter is a Mod and are the mods that should be applied to the bot. If two mods have the same tag, then the mod that is last in the list will win.

    Examples
    Set the "test" tag and "name" tag on a bot
    applyMod(bot, {
    test: true,
    name: "bob"
    });
  • getMod(bot: any, ...tags: (string | RegExp)[]): Mod

    Creates a mod from exported mod data.

    The first parameter is a any and is the mod data that should be loaded.

    Each other parameter is a (string | RegExp) and are the tags that should be included in the output mod.

  • subtractMods(bot: any, ...mods: Mod[]): void

    Removes the tags contained in the given mod(s) from the given bot or mod.

    The first parameter is a any and is the the bot or mod that the tags should be removed from.

    Each other parameter is a Mod and are the bots or mods that contain the tags which should be removed from the original bot.

    Examples
    Remove a mod from this bot
    const mod = {
    color: 'red',
    name: 'bob'
    };
    subtractMods(this, mod);
    Remove multiple mods from this bot
    subtractMods(this, {
    color: 'red'
    }, {
    name: 'bob'
    });