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.
| Column | Type | Default | Description |
|---|
user_id | TEXT NOT NULL | — | Discord user ID (snowflake as string) |
guild_id | TEXT NOT NULL | — | Discord guild ID (snowflake as string) |
glow_shards | INTEGER NOT NULL | 0 | Primary currency balance |
vibe_coins | INTEGER NOT NULL | 0 | Secondary currency balance |
total_hunts | INTEGER NOT NULL | 0 | Lifetime hunt count for this user in this guild |
hunt_streak | INTEGER NOT NULL | 0 | Current consecutive hunt streak |
last_hunt | REAL NOT NULL | 0 | Unix 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.
| Column | Type | Default | Description |
|---|
id | INTEGER | — | Auto-incrementing primary key |
user_id | TEXT NOT NULL | — | Discord user ID |
guild_id | TEXT NOT NULL | — | Discord guild ID |
creature_id | TEXT NOT NULL | — | Creature identifier from vibe_creatures/data.json (e.g. "gloomfox") |
caught_at | REAL NOT NULL | 0 | Unix timestamp of when the creature was caught |
fused | INTEGER NOT NULL | 0 | Reserved 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.
| Column | Type | Default | Description |
|---|
id | INTEGER | — | Auto-incrementing primary key |
user_id | TEXT NOT NULL | — | Discord user ID |
badge_name | TEXT NOT NULL | — | Internal badge key (e.g. "donor", "hunter_10", "mythic") |
awarded_at | REAL NOT NULL | 0 | Unix 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:
| Key | Display name | Requirement |
|---|
donor | 💎 Donor | First successful donation |
hunter_10 | 🏹 Hunter I | 10 total hunts |
hunter_50 | 🏹 Hunter II | 50 total hunts |
hunter_100 | 🏹 Hunter III | 100 total hunts |
legendary | 🌟 Legendary Finder | Catch a legendary creature |
mythic | 🌌 Mythic Witness | Catch a mythic creature |
streak_25 | 🔥 Hot Streak | Reach 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.
| Column | Type | Default | Description |
|---|
id | INTEGER | — | Auto-incrementing primary key |
user_id | TEXT NOT NULL | — | Discord user ID of the donor |
amount_usd | REAL NOT NULL | — | USD value of the donation |
currency | TEXT NOT NULL | 'USDT' | Crypto currency used (e.g. USDT, BTC, ETH) |
tx_id | TEXT NOT NULL | — | OxaPay trackId returned at invoice creation |
awarded_at | REAL NOT NULL | 0 | Unix 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.
| Column | Type | Default | Description |
|---|
guild_id | TEXT NOT NULL | — | Discord guild ID |
prefix | TEXT NOT NULL | — | The 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.