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.

All Kojima Bot configuration is driven by environment variables stored in a .env file at the project root. On startup, src/config.ts loads this file via dotenv, validates the three required variables, and exports a typed CONFIG object that every module imports. There is no configuration UI or database-backed settings table — every knob is a variable in .env.

.env.example

Copy this file to .env and fill in your values before running bun start or bun run deploy:
# Required (Discord Developer Portal → your app → Bot token; Application ID = CLIENT_ID)
DISCORD_TOKEN=your_token_here
CLIENT_ID=your_client_id_here
GUILD_ID=your_guild_id_here

# Re-skin the catch game label (default if unset: Cat)
ENTITY_NAME=Kojima

# Optional: phrase users type to catch (default: ENTITY_NAME lowercased)
# CATCH_TRIGGER=kojima

# Optional: mirror pasted social URLs for better Discord embeds.
# Deletes the user's message and reposts "**Name** shared:\n<fixed URLs>"
# Requires Manage Messages + Send Messages in that channel/thread.
# Enable with: true, 1, yes, or on
LINK_FIXUP_X=false
LINK_FIXUP_INSTAGRAM=false

# Optional: SQLite file path (default: bot.sqlite next to cwd)
# DB_FILE=bot.sqlite

Required variables

DISCORD_TOKEN
string
required
The bot token issued by the Discord Developer Portal. Navigate to your application → Bot tab → Token and click Reset Token to generate one. This value authenticates the bot with the Discord Gateway — guard it carefully and never share it publicly.
CLIENT_ID
string
required
Your Discord application’s Application ID, found on the General Information tab of the Developer Portal. This is used when registering slash commands via bun run deploy.
GUILD_ID
string
required
The ID of the Discord server where slash commands are registered. Enable Developer Mode in Discord (User Settings → Advanced), then right-click your server and choose Copy Server ID. Guild-scoped commands appear instantly, unlike global commands which can take up to an hour to propagate.

Optional variables

ENTITY_NAME
string
default:"Cat"
The display name for spawned entities, used throughout bot messages and embeds (e.g. “A wild Kojima appeared!”). Change this to reskin the catch game without touching source code. When this variable is changed, also update CATCH_TRIGGER if you have it set explicitly, or leave it unset to have the trigger derive automatically.
CATCH_TRIGGER
string
default:"ENTITY_NAME lowercased"
The exact phrase players must type in the channel to catch a spawn. Defaults to the lowercase value of ENTITY_NAME — so if ENTITY_NAME=Kojima, the trigger is kojima. Override this if you want the display name and catch phrase to differ, or if you want to use a phrase with spaces or special characters.
# Example: display "Gnome" but catch with "garden gnome"
ENTITY_NAME=Gnome
CATCH_TRIGGER=garden gnome
When enabled, the bot watches for messages containing x.com or twitter.com URLs. It deletes the original message and reposts it as **DisplayName** shared: <fixed URL> with the domain rewritten to fixupx.com, which produces rich video embeds that Discord normally suppresses for these domains.Requires Manage Messages and Send Messages permissions in every channel or thread where link fixup should apply.Accepted truthy values: true, 1, yes, on (case-insensitive). Any other value — including false — disables the feature.
Same behaviour as LINK_FIXUP_X, but for instagram.com URLs, which are rewritten to vxinstagram.com. Query strings are stripped from Instagram URLs during rewriting.Requires the same Manage Messages + Send Messages permissions as LINK_FIXUP_X.Accepted truthy values: true, 1, yes, on (case-insensitive).
DB_FILE
string
default:"bot.sqlite"
Path to the SQLite database file, relative to the project root. The file is created automatically on first run if it does not exist. Change this if you want to store the database on a different volume or keep multiple isolated instances on the same host.
# Store the database in a dedicated data directory
DB_FILE=/var/data/kojima/production.sqlite

How booleans are parsed

The LINK_FIXUP_* variables are parsed by the envEnabled helper in src/config.ts. The raw string value is trimmed and lowercased, then compared against a fixed set of truthy tokens:
ValueResult
true✅ Enabled
1✅ Enabled
yes✅ Enabled
on✅ Enabled
false❌ Disabled
0❌ Disabled
no❌ Disabled
(empty / unset)❌ Disabled
Comparison is case-insensitive, so TRUE, Yes, and ON all enable the feature. Anything not in the truthy list evaluates to false — there is no error for an unrecognised value.
Never commit your .env file to version control. The repository’s .gitignore already excludes it, but double-check before pushing — especially if you forked the repo or changed the ignore rules. A leaked DISCORD_TOKEN lets anyone operate the bot under your application’s identity.

Build docs developers (and LLMs) love