These are miscellaneous utilities that can be useful in various ways.
This function checks if the bot can see another player.
const canSee = bot.canSee(player);
console.log(`Can see player: ${canSee}`); // true or false
This closes the connection to the game, the matchmaker, and runs various cleanup functions.
Cleanup includes deleting nearly all properites on a bot, including bot.account, bot.game, and bot.players.
Once a bot has been quit, it cannot be used again. You must create a new bot to rejoin the game.
bot.quit();
If bot.quit is too much for you, and you want to be able to reuse a bot, you can use bot.leave() instead. This will leave the game, but keep the bot object intact so that you can rejoin games later.
bot.leave();
bot.state.inGame: boolean - is the bot in a game?bot.matchmaker: Matchmaker - a Matchmaker instance tied to the botbot.api: API - an API instance tied to the botbot.ping: number - the bot's ping (requires the PING intent)These are miscellaneous utilities that can be useful in various ways.
This function checks if the bot can see another player.
const canSee = bot.canSee(player);
console.log(`Can see player: ${canSee}`); // true or false
This closes the connection to the game, the matchmaker, and runs various cleanup functions.
Cleanup includes deleting nearly all properites on a bot, including bot.account, bot.game, and bot.players.
Once a bot has been quit, it cannot be used again. You must create a new bot to rejoin the game.
bot.quit();
If bot.quit is too much for you, and you want to be able to reuse a bot, you can use bot.leave() instead. This will leave the game, but keep the bot object intact so that you can rejoin games later.
bot.leave();
bot.state.inGame: boolean - is the bot in a game?bot.matchmaker: Matchmaker - a Matchmaker instance tied to the botbot.api: API - an API instance tied to the botbot.ping: number - the bot's ping (requires the PING intent)