Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/developer51709/Noxie/llms.txt

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

Noxie uses a single SQLite file for all persistent data — economy balances, creature inventories, badges, donation records, and per-guild custom prefixes. The database is created automatically on first run; you do not need to install or configure any external database server. This page documents the full schema so you can inspect, back up, or manually modify the data if needed.

Database Location

The database file path is controlled by the db_path field in config.json. The default value is:
{
  "db_path": "db/noxie.db"
}
This resolves to a db/ subdirectory inside the project root. The directory is created automatically by get_db_conn() in utils/helpers.py if it does not already exist.

Initialization

Two functions handle schema creation at startup, both called from setup_hook in main.py:
  • init_prefix_table(conn) — defined in cogs/prefixes.py; creates the guild_prefixes table.
  • init_economy_db(conn) — defined in utils/economy.py; creates the economy, inventory, badges, and donations tables.
Both functions use CREATE TABLE IF NOT EXISTS, so they are completely safe to run on every bot start — they will not overwrite or reset existing data.

Tables

economy

Stores per-user, per-guild economy state: currency balances, hunt statistics, and cooldown tracking.
ColumnTypeDefaultDescription
user_idTEXT NOT NULLDiscord user ID (snowflake as string)
guild_idTEXT NOT NULLDiscord guild ID (snowflake as string)
glow_shardsINTEGER NOT NULL0Primary currency balance
vibe_coinsINTEGER NOT NULL0Secondary currency balance
total_huntsINTEGER NOT NULL0Lifetime hunt count for this user in this guild
hunt_streakINTEGER NOT NULL0Current consecutive hunt streak
last_huntREAL NOT NULL0Unix timestamp of the most recent hunt (used for cooldown enforcement)
Primary key: (user_id, guild_id) — one row per user per guild.
CREATE TABLE IF NOT EXISTS economy (
    user_id     TEXT NOT NULL,
    guild_id    TEXT NOT NULL,
    glow_shards INTEGER NOT NULL DEFAULT 0,
    vibe_coins  INTEGER NOT NULL DEFAULT 0,
    total_hunts INTEGER NOT NULL DEFAULT 0,
    hunt_streak INTEGER NOT NULL DEFAULT 0,
    last_hunt   REAL    NOT NULL DEFAULT 0,
    PRIMARY KEY (user_id, guild_id)
);

inventory

Records every creature a user has caught. Multiple rows for the same creature_id are valid — users can catch duplicates.
ColumnTypeDefaultDescription
idINTEGERAuto-incrementing primary key
user_idTEXT NOT NULLDiscord user ID
guild_idTEXT NOT NULLDiscord guild ID
creature_idTEXT NOT NULLCreature identifier from vibe_creatures/data.json (e.g. "gloomfox")
caught_atREAL NOT NULL0Unix timestamp of when the creature was caught
fusedINTEGER NOT NULL0Reserved for future fusion mechanic; 0 = active, 1 = consumed
Primary key: id (AUTOINCREMENT).
CREATE TABLE IF NOT EXISTS inventory (
    id          INTEGER PRIMARY KEY AUTOINCREMENT,
    user_id     TEXT    NOT NULL,
    guild_id    TEXT    NOT NULL,
    creature_id TEXT    NOT NULL,
    caught_at   REAL    NOT NULL DEFAULT 0,
    fused       INTEGER NOT NULL DEFAULT 0
);

badges

Tracks awarded badges per user. The UNIQUE constraint on (user_id, badge_name) ensures each badge is granted at most once per user, regardless of guild.
ColumnTypeDefaultDescription
idINTEGERAuto-incrementing primary key
user_idTEXT NOT NULLDiscord user ID
badge_nameTEXT NOT NULLInternal badge key (e.g. "donor", "hunter_10", "mythic")
awarded_atREAL NOT NULL0Unix timestamp of when the badge was awarded
Primary key: id (AUTOINCREMENT). Unique constraint: (user_id, badge_name) — prevents duplicate awards.
CREATE TABLE IF NOT EXISTS badges (
    id         INTEGER PRIMARY KEY AUTOINCREMENT,
    user_id    TEXT    NOT NULL,
    badge_name TEXT    NOT NULL,
    awarded_at REAL    NOT NULL DEFAULT 0,
    UNIQUE(user_id, badge_name)
);
The full set of badge keys and their display names:
KeyDisplay nameRequirement
donor💎 DonorFirst successful donation
hunter_10🏹 Hunter I10 total hunts
hunter_50🏹 Hunter II50 total hunts
hunter_100🏹 Hunter III100 total hunts
legendary🌟 Legendary FinderCatch a legendary creature
mythic🌌 Mythic WitnessCatch a mythic creature
streak_25🔥 Hot StreakReach a 25-hunt streak

donations

An append-only log of every successfully confirmed donation. The OxaPay trackId is stored as tx_id for external auditability.
ColumnTypeDefaultDescription
idINTEGERAuto-incrementing primary key
user_idTEXT NOT NULLDiscord user ID of the donor
amount_usdREAL NOT NULLUSD value of the donation
currencyTEXT NOT NULL'USDT'Crypto currency used (e.g. USDT, BTC, ETH)
tx_idTEXT NOT NULLOxaPay trackId returned at invoice creation
awarded_atREAL NOT NULL0Unix timestamp of when rewards were credited
Primary key: id (AUTOINCREMENT).
CREATE TABLE IF NOT EXISTS donations (
    id         INTEGER PRIMARY KEY AUTOINCREMENT,
    user_id    TEXT    NOT NULL,
    amount_usd REAL    NOT NULL,
    currency   TEXT    NOT NULL DEFAULT 'USDT',
    tx_id      TEXT    NOT NULL,
    awarded_at REAL    NOT NULL DEFAULT 0
);

guild_prefixes

Stores custom per-guild prefixes added via noxie prefix add. The global prefix noxie is hardcoded in main.py and is never written to this table.
ColumnTypeDefaultDescription
guild_idTEXT NOT NULLDiscord guild ID
prefixTEXT NOT NULLThe custom prefix string (e.g. "!", "n!")
Primary key: (guild_id, prefix) — each prefix is unique per guild, and a guild can have multiple custom prefixes.
CREATE TABLE IF NOT EXISTS guild_prefixes (
    guild_id TEXT NOT NULL,
    prefix   TEXT NOT NULL,
    PRIMARY KEY (guild_id, prefix)
);

Backing Up Your Data

Because all data lives in a single file, backing up is straightforward — just copy db/noxie.db while the bot is stopped (or use SQLite’s online backup API if you need hot backups):
cp db/noxie.db db/noxie.db.bak
To restore, stop the bot, replace db/noxie.db with your backup copy, and restart.
Economy data, inventory, and guild prefixes are scoped per-guild — each server has its own balances and creature collections. Badge data is global per user: a badge earned in one server appears on the user’s profile in every server.
To fully reset a single user’s economy data in a specific guild without touching their inventory or badges, run:
DELETE FROM economy WHERE user_id = '123456789' AND guild_id = '987654321';
The row will be recreated with default zero values the next time that user interacts with the economy system.

Build docs developers (and LLMs) love