Eggforcers and Admins alike are supported by yolkbot, if they ever decide to use it.
None of the things here are ever mentioned elsewhere in the docs.
To use ANY of these, the bot must be authenticated with a valid eggforcer or admin account.
Your yolkbot can observe the game just like you. Use the OBSERVE_GAME intent:
const bot = new Bot({
intents: [Intents.OBSERVE_GAME],
});
Similar to when an eggforcer observes a game:
ChatDispatches sent by the bot will be prefixed with MOD or SERVER, depending on the user's permissions.SpawnDispatches, because it is not a player.bot.account.adminRoles has the account's admin role bitmap. For normal users, this is 0. Here are the known bitmap values:
If an admin requests player info, the playerInfo hook will be called with the requested player's info. This is useful for logging or other admin tasks.
bot.on('playerInfo', (player, playerIp, playerDBId) => {
console.log(`${player.name}: IP = ${playerIp}, DB ID = ${playerDBId}`);
});
This hook will also add the values to player.admin.ip and player.admin.dbId, so you can access them directly from the player object in the future.
You can ban players with the BanPlayerDispatch.
import BanPlayerDispatch from 'yolkbot/dispatches/BanPlayerDispatch';
import { BanDuration } from 'yolkbot/constants';
bot.on('chat', (player, message) => {
if (message === 'i\'m hacking') {
bot.dispatch(new BanPlayerDispatch(player.uniqueid, BanDuration.OneHour, 'Hacking detected (automated ban)'));
}
});
Just like ingame, you can leave the reason out to avoid sending a reason.
The valid BanDuration values are:
BanDuration.FiveMinutesBanDuration.FifteenMinutesBanDuration.OneHourThere are a couple things to note:
OBSERVE_GAME, the bot will not send messages normally; it will instead use the green MOD or yellow SERVER tag.Happy eggforcing!
Eggforcers and Admins alike are supported by yolkbot, if they ever decide to use it.
None of the things here are ever mentioned elsewhere in the docs.
To use ANY of these, the bot must be authenticated with a valid eggforcer or admin account.
Your yolkbot can observe the game just like you. Use the OBSERVE_GAME intent:
const bot = new Bot({
intents: [Intents.OBSERVE_GAME],
});
Similar to when an eggforcer observes a game:
ChatDispatches sent by the bot will be prefixed with MOD or SERVER, depending on the user's permissions.SpawnDispatches, because it is not a player.bot.account.adminRoles has the account's admin role bitmap. For normal users, this is 0. Here are the known bitmap values:
If an admin requests player info, the playerInfo hook will be called with the requested player's info. This is useful for logging or other admin tasks.
bot.on('playerInfo', (player, playerIp, playerDBId) => {
console.log(`${player.name}: IP = ${playerIp}, DB ID = ${playerDBId}`);
});
This hook will also add the values to player.admin.ip and player.admin.dbId, so you can access them directly from the player object in the future.
You can ban players with the BanPlayerDispatch.
import BanPlayerDispatch from 'yolkbot/dispatches/BanPlayerDispatch';
import { BanDuration } from 'yolkbot/constants';
bot.on('chat', (player, message) => {
if (message === 'i\'m hacking') {
bot.dispatch(new BanPlayerDispatch(player.uniqueid, BanDuration.OneHour, 'Hacking detected (automated ban)'));
}
});
Just like ingame, you can leave the reason out to avoid sending a reason.
The valid BanDuration values are:
BanDuration.FiveMinutesBanDuration.FifteenMinutesBanDuration.OneHourThere are a couple things to note:
OBSERVE_GAME, the bot will not send messages normally; it will instead use the green MOD or yellow SERVER tag.Happy eggforcing!