logo bannerlogo banner
Page Navigator

You can control an account and do various tasks, from buying things in the shop to playing Chikn Winner.

Chikn Winner

These methods allow you to play Chikn Winner.

[async] bot.checkChiknWinner

Allows you to check the status of the Chikn Winner minigame for the account. It returns something like this:

await bot.checkChiknWinner() /* -> {
    atLimit: false,
    limit: 1,
    secondsUntilPlay: 240,
    canPlayAgain: 1742002470386
} */

These are identical to the properties in bot.account.cw, which you can read about in the Account Properties section.

[async] bot.playChiknWinner

Allows you to play the Chikn Winner minigame. It will either return what you pulled, which either is eggs:

await bot.playChiknWinner() /* -> {
    eggsGiven: 100,
    itemIds: [],
    rewardTier: 2
} */

or an item:

await bot.playChiknWinner() /* -> {
    eggsGiven: 0,
    itemIds: [3066],
    rewardTier: 1
} */

It may also return a string, which is one of these errors:

  • hit_daily_limit - the bot has hit the daily limit, run bot.resetChiknWinner() to reset the limit for 200 eggs
  • on_cooldown - chikn winner is on cooldown, see bot.account.cw.secondsUntilPlay for the seconds until you can play again
  • session_expired - the bot's session expired, usually because the bot's account was deleted due to bot detection
  • unknown_error - an unknown error returned by shell - create an issue on github with the content in the console

You can also pass true to the first parameter, which can sometimes fix issues with false cooldown calculation. If you don't have any issues with this, leave it as-is.

[async] bot.resetChiknWinner

Allows you to reset Chikn Winner for 200 eggs if you have hit the daily limit.

If it successfully resets, it will return the Chikn Winner status (from bot.checkChiknWinner()).

It may also fail, returning one of these errors:

  • not_at_limit - the bot is not at the limit for the day, and you should play normally
  • not_enough_eggs - the bot does not have enough eggs to reset
  • unknown_error - an unknown error returned by shell - create an issue on github with the content in the console

Challenges

These methods all require the CHALLENGES intent to be enabled.

[async] bot.refreshChallenges

Refreshes the challenges for the account. This will return the challenges, which is an array of challenges. See bot.account.challenges for more information.

[async] bot.claimChallenge

Claims a completed challenge. This will return the egg reward and the updated challenge list.

const firstChallengeId = bot.account.challenges[0].id; // must have been completed
const result = await bot.claimChallenge(firstChallengeId);

console.log('the bot got', result.eggReward, 'eggs');
console.log('the bot now has', bot.account.eggBalance, 'eggs');
console.log('updated challenge list', result.updatedChallenges);

[async] bot.rerollChallenge

Rerolls a challenge that has not yet been completed. This will return the updated challenge list.

const firstChallengeId = bot.account.challenges[0].id; // must not have been completed
const result = await bot.rerollChallenge(firstChallengeId);
console.log('updated challenge list', result);

Shop

We love spending sprees!

[async] bot.refreshBalance

Refreshes the account's balance. This will return the updated balance.

const balance = await bot.refreshBalance();
console.log('the bot now has', balance, 'eggs');

[async] bot.buyItem

Allows you to buy an item from the shop. You must pass the item ID.

const itemId = 1234; // replace with the actual item ID
const result = await bot.buyItem(itemId);
console.log('the bot bought item with ID', result.itemId);
console.log('the bot now has', result.currentBalance, 'eggs');

[async] bot.redeemCode

Allows you to redeem a code for the account. You must pass the code as a string.

const code = 'FREEEGGS123'; // replace with the actual code
const result = await bot.redeemCode(code);
console.log('the bot redeemed code', code);
console.log('redeem result:', result.result);
console.log('gave eggs:', result.eggsGiven);
console.log('gave items:', result.itemIds);

[async] bot.claimURLReward

Allows you to claim one of the URL rewards (like ?midMonthGiveMeEggs). You must pass the param as a string.

const reward = 'midMonthGiveMeEggs'; // replace with the actual reward param
const result = await bot.claimURLReward(reward);
console.log('redeem result:', result.result);
console.log('gave eggs:', result.eggsGiven);
console.log('gave items:', result.itemIds);

[async] bot.claimSocialReward

Allows you to claim one of the rewards redeemed by clicking a social media link on the home screen. Note that we mapped all of these in the constants.

import { SocialReward } from 'yolkbot/constants';

const result = await bot.claimSocialReward(SocialReward.Discord);

console.log('redeem result:', result.result);
console.log('gave eggs:', result.eggsGiven);
console.log('gave items:', result.itemIds);

Logging Out

This is done using bot.logout().

bot.logout();

Once a bot has logged out, the bot.account object will LOSE ALL INFORMATION to prepare for a new account. If you need bot.account information after logging out, you should save it before logging out.