logo bannerlogo banner
Page Navigator

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.

Note

To use ANY of these, the bot must be authenticated with a valid eggforcer or admin account.

Game Observation

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:

  • Any ChatDispatches sent by the bot will be prefixed with MOD or SERVER, depending on the user's permissions.
  • The bot cannot fire any SpawnDispatches, because it is not a player.
  • The bot will bypass any player limit and will not appear on the player list.

adminRoles

bot.account.adminRoles has the account's admin role bitmap. For normal users, this is 0. Here are the known bitmap values:

  • 1 - can manage admins
  • 2 - can boot players globally
  • 4 - can ban players globally
  • 8 - can manage feedback sent by the feedback function
  • 16 - can control ingame announcements
  • 32 - can manage ingame ads
  • 64 - can request player info (db ID, IP)
  • 128 - can issue refunds
  • 256 - can manage chikn winner
  • 512 - can manage media (the videos on homepage)
  • 1024 - can manage badguys (a histogram of IPs that spam the API)
  • 2048 - can manage ingame items
  • 4096 - unused, named "bots" and seems to be an unfinished game botting feature
  • 8192 - can ban IPs from the game
  • 16384 - can blacklist people from the ingame Twitch feed

playerInfo hook

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.

Banning Players

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.FiveMinutes
  • BanDuration.FifteenMinutes
  • BanDuration.OneHour

Chatting

There are a couple things to note:

  1. When observing using OBSERVE_GAME, the bot will not send messages normally; it will instead use the green MOD or yellow SERVER tag.
  2. Logged in eggforcers with ANY level of permissions do not have any chat cooldown, no matter if the lobby is public or private.

Happy eggforcing!