Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/noskap/kojima-bot/llms.txt

Use this file to discover all available pages before exploring further.

Kojima Bot’s spawn game is the core activity loop: the bot periodically posts a spawn embed in a configured channel, displaying a rarity-labelled image of the entity. The first player to type the catch phrase in chat or click the Catch! button on the embed wins the catch. Wins accumulate on the player’s server profile, unlock achievements, and award casino chips.

Rarity system

Every spawn is decided by a weighted random roll across 22 rarities. The rollRarity() function sums all weights (totalling 4,685), picks a random number in that range, then walks the list until it finds the winning entry. Lower weight = rarer spawn.
Display NameFile KeyWeight
Stylishstylish900
Sicksick700
Matrixmatrix550
Supersuper400
Drunkdrunk320
Bananabanana260
Chicken Hatchicken_hat220
Disguiseddisguised200
Crowbarcrowbar180
Exerciseexercise150
Valvevalve140
Combatcombat130
Mocapmocap110
Brokenbroken95
Rarerare85
Russianrussian75
Porterporter45
Alienalien40
Sushisushi30
Mexicanmexican25
Burgerburger18
Weedweed12
Spawn images are loaded from assets/images/spawn/<fileKey>.jpg (or .png, .jpeg, .webp). If the exact file is missing, the bot also tries a <fileKey>_cat variant before falling back to the default assets/images/cat.png.

Spawn timer

After each successful catch the bot calculates a cooldown delay and stores it in the channel row:
  • Random delay — a random integer between spawnTimesMin and spawnTimesMax seconds. The defaults are 60 s (min) and 450 s (max).
  • Tick buffer — an extra ~10 seconds is added on top of the random delay so the spawn loop does not fire while Discord I/O is still settling.
  • Spawn loop intervaltickSpawns runs every ~4 seconds and posts a spawn to any eligible channel whose cooldown has expired and has no active spawn.
To change the timer range for a channel, update spawnTimesMin and spawnTimesMax in the database or via the channel setup command.

Catching a spawn

There are two ways to claim an active spawn: Method 1 — Chat trigger Type the catch phrase (configured as CATCH_TRIGGER in .env, defaults to the lowercased value of ENTITY_NAME) as your entire message. The bot compares message.content.trim().toLowerCase() against CATCH_TRIGGER exactly. Method 2 — Catch! button Click the green Catch! button attached to the spawn embed. Both paths lead to the same executeCatch handler. Only the first player wins. Subsequent attempts get an ephemeral “Too slow — that spawn is already gone” reply. Typing the catch phrase when no spawn is active earns a 😂 reaction instead.
A concurrency guard (processingSpawnIds) ensures that even if two players fire at the same millisecond only one catch is recorded. The handler re-reads the channel row inside the lock and aborts if the spawn ID no longer matches.

Catch result embed

When a catch is registered, the bot deletes the spawn message and posts a celebration embed containing:
  • Rarity and entity name — e.g. “Alien Cat caught!”
  • Player display name and catch time — formatted as milliseconds (ms) when under 1 s, seconds (s) when under 60 s, or minutes and seconds (m s) for longer waits.
  • Server catch count — shown in the footer as “Your catches (this server): N”.
  • Newly unlocked achievements — if the catch triggered one or more achievement unlocks they appear as an inline field titled ”🏆 Achievement unlocked”.
The countSus slot (Disguised rarity) triggers a special 15% chance easter-egg footer line: “Not suspicious at all.”

Active spawn state

Only one spawn can be active per channel at a time. The channels table stores the active spawn message ID in the cat column; a value of "0" means no active spawn.
  • /kojima forcespawn — clears any existing active spawn (greying it out as “superseded”), resets the cooldown to zero, and immediately posts a new one. Use this to test the system or unstick a channel.
  • /kojima next — shows the current channel state including whether a spawn is active, the cooldown expiry, and the last catcher.
Use /kojima forcespawn type:Rare to immediately post a specific rarity without waiting for the random timer. You can pass either the display name (e.g. Alien) or the file key (e.g. chicken_hat) to the type option.

Build docs developers (and LLMs) love