You can control an account and do various tasks, from buying things in the shop to playing Chikn Winner.
These methods allow you to play Chikn Winner.
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.
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 eggson_cooldown - chikn winner is on cooldown, see bot.account.cw.secondsUntilPlay for the seconds until you can play againsession_expired - the bot's session expired, usually because the bot's account was deleted due to bot detectionunknown_error - an unknown error returned by shell - create an issue on github with the content in the consoleYou 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.
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 normallynot_enough_eggs - the bot does not have enough eggs to resetunknown_error - an unknown error returned by shell - create an issue on github with the content in the consoleThese methods all require the CHALLENGES intent to be enabled.
Refreshes the challenges for the account. This will return the challenges, which is an array of challenges. See bot.account.challenges for more information.
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);
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);
We love spending sprees!
Refreshes the account's balance. This will return the updated balance.
const balance = await bot.refreshBalance();
console.log('the bot now has', balance, 'eggs');
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');
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);
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);
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);
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.
You can control an account and do various tasks, from buying things in the shop to playing Chikn Winner.
These methods allow you to play Chikn Winner.
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.
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 eggson_cooldown - chikn winner is on cooldown, see bot.account.cw.secondsUntilPlay for the seconds until you can play againsession_expired - the bot's session expired, usually because the bot's account was deleted due to bot detectionunknown_error - an unknown error returned by shell - create an issue on github with the content in the consoleYou 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.
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 normallynot_enough_eggs - the bot does not have enough eggs to resetunknown_error - an unknown error returned by shell - create an issue on github with the content in the consoleThese methods all require the CHALLENGES intent to be enabled.
Refreshes the challenges for the account. This will return the challenges, which is an array of challenges. See bot.account.challenges for more information.
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);
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);
We love spending sprees!
Refreshes the account's balance. This will return the updated balance.
const balance = await bot.refreshBalance();
console.log('the bot now has', balance, 'eggs');
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');
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);
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);
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);
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.