A mystical puzzle experience where players progress through 7 trials to resurrect a faded idol named Ika.
For non-technical users, see NORMIES.md For the complete gate guide, see GATES.md For command reference, see COMMANDS.md For full version history, see CHANGELOG.md
# 1. Clone & install
git clone <repo> && cd seven-gates && npm install
# 2. Configure
cp .env.example .env
# Edit .env: DISCORD_TOKEN, CLIENT_ID
# 3. Deploy & run
npm run deploy && npm startBot auto-creates channels/roles when joining a server.
- Node.js 18+
- Discord Bot with Privileged Intents:
- Message Content Intent
- Server Members Intent
- Presence Intent
- Anthropic API Key (optional, for AI features)
src/
├── index.js # Entry point
├── config.js # Environment config
├── database.js # SQLite operations
├── commands/ # Slash commands
│ ├── memory.js # Gate 2
│ ├── confess.js # Gate 3
│ ├── waters.js # Gate 4
│ ├── absence.js # Gate 5
│ ├── offering.js # Gate 6
│ ├── binding.js # Gate 7
│ ├── journey.js # Progress tracker
│ ├── help.js # Command reference
│ ├── bond.js # Relationship viewer
│ ├── mysteries.js # Secret discovery
│ ├── admin.js # Admin tools
│ ├── adminPanel.js # Comprehensive testing
│ └── setup.js # Server setup
├── events/ # Discord events
├── gates/ # Gate logic
├── ika/ # AI personality system (42 modules)
│ ├── generator.js # Claude API integration
│ ├── personality.js # System prompts
│ ├── moods.js # Mood system
│ ├── memory.js # User memory
│ ├── voiceFilter.js # Response filtering (P0)
│ ├── interactionQuality.js # Quality multipliers
│ ├── patronTiers.js # Patron handling
│ ├── boundPairs.js # User pair relationships
│ ├── postAscension.js # Seasonal endgame content
│ ├── daily.js # Daily engagement streaks
│ └── ... # 30+ feature modules
├── ui/ # Ritual UI system
│ ├── builders/ # Embed builders
│ │ ├── ritualEmbed.js # Themed embeds
│ │ ├── ritualSequence.js # Multi-message reveals
│ │ ├── flexCards.js # Screenshot-worthy cards
│ │ └── paginatedEmbed.js # Paginated content
│ ├── themes/ # Visual themes
│ │ ├── gateThemes.js # Per-gate styling
│ │ └── moodOverlays.js # Mood modifications
│ └── components/ # UI components
│ └── errorMessages.js # Lore-consistent errors
└── utils/
├── optimization.js # Rate limiting, caching, spam
├── costMode.js # API cost management
├── validation.js # Input validation
└── ...
DISCORD_TOKEN=your_bot_token
CLIENT_ID=your_application_idANTHROPIC_API_KEY=your_key
IKA_AI_ENABLED=trueGATE_2_ANSWERS=answer1,answer2,answer3
GATE_4_ANSWERS=answer1,answer2COST_MODE=ultraLow # normal|low|ultraLow|minimal|free| Mode | AI Access | Est. Cost (100K users) |
|---|---|---|
| normal | Everywhere | $1000-2000/mo |
| low | Everywhere (Haiku) | $200-500/mo |
| ultraLow | Inner Sanctum only | $50-150/mo |
| minimal | 5 calls/day | $20-50/mo |
| free | None | $0 |
npm start # Production
npm run dev # Development (auto-reload)
npm run deploy # Register slash commands- SQLite via
better-sqlite3 - Tables:
users,ika_memory,offerings,vows,gate5_schedule, etc. - Indexes for 100K+ user performance
- SQL injection protection via column allowlists
- SSRF protection in URL validation
- Rate limiting per-user, per-channel, global
- Spam detection with cumulative scoring
- Claude API (Sonnet/Haiku)
- Cost optimization via tiered access
- Canned response fallbacks (500+ responses)
- Response caching with TTL
// User tiers with different limits
new: { maxRequests: 10, windowMs: 300000, minIntervalMs: 5000 }
normal: { maxRequests: 20, windowMs: 300000, minIntervalMs: 3000 }
devoted: { maxRequests: 40, windowMs: 300000, minIntervalMs: 2000 }
ascended: { maxRequests: 60, windowMs: 300000, minIntervalMs: 1000 }See GATES.md for the complete gate guide with detailed walkthroughs.
| Gate | Command | Validation |
|---|---|---|
| 1 | Say "ika" in waiting room | containsIka() |
| 2 | /memory [answer] |
validateGate2Answer() |
| 3 | /confess [url] |
isValidUrl() |
| 4 | /waters [answer] |
validateGate4Answer() |
| 5 | /absence [reason] |
Timed sequence + 15 char min |
| 6 | /offering |
50+ words or image |
| 7 | /binding [vow] |
30+ words, community approval |
| Command | Description | Availability |
|---|---|---|
/journey |
View your path through the gates | Everyone |
/help |
See available commands | Everyone |
/profile [user] |
View detailed user profile | Everyone |
/bond |
View your relationship with Ika | Gate 1+ |
/mysteries |
Track discovered secrets | Gate 1+ |
/leaderboard |
Community statistics | Everyone |
| Command | Description | Availability |
|---|---|---|
/hint [gate] |
Get guidance (costs Ika's attention) | Gate 1+ |
/dms |
Enable/disable Ika's whispers | Gate 1+ |
/invite |
Generate referral link | Gate 1+ |
| Command | Description |
|---|---|
/shrine |
View your personal shrine |
/trials |
See devotion trial progress |
/dossier |
View investigation fragments |
Main AI response generation with priority system:
- Serious mental health concerns
- Protection triggers
- Secret phrase triggers
- Time-based secrets
- Rare events
- Roast opportunities
- Jealousy check
- Canned responses
- AI generation
Cost optimization engine:
- Channel restrictions (AI only in sanctum)
- Daily quotas per user tier
- Model selection (Sonnet vs Haiku)
- Canned response fallbacks
Scale management:
RateLimiter- Per-user/channel limitsSpamDetector- Pattern matching, scoringResponseCache- TTL-based cachingUserTiering- Priority calculations
SQLite operations with security:
ALLOWED_USER_COLUMNS/ALLOWED_MEMORY_COLUMNSallowlistsisValidColumn()validation- Parameterized queries throughout
| Command | Description |
|---|---|
/admin stats |
View statistics |
/admin reset @user |
Reset user progress |
/admin advance @user [gate] |
Advance user |
/admin approve @user |
Approve submission |
/admin testmode [on/off] |
Fast Gate 5 |
/admin broadcast [gate] [msg] |
DM users |
// src/ika/personality.js
const CANNED_RESPONSES = {
newTrigger: [
"response 1",
"response 2",
],
};- Add to schema in
database.js - Add to
ALLOWED_USER_COLUMNSorALLOWED_MEMORY_COLUMNS - Create operation functions
COST_MODE=free npm start # Test canned-only mode
COST_MODE=minimal npm start # Test strict quotasSee CHANGELOG.md for full version history.
Latest:
- v5.0.0 - Vibing Overhaul: Quality multipliers, patron tiers, bound pairs, post-ascension endgame, flex cards, daily engagement, referral system
- v4.2.0 - Canon compliance (removed fading resurrection), error handling improvements
- v4.1.0 - UX overhaul:
/journey,/help,/bond,/mysteriescommands - v4.0.0 - Occult otaku UI system with ritual embeds
- v3.4.0 - Comprehensive admin panel
- v3.3.0 - Scale optimization, security fixes (100K+ users)
Private project.
♡ she's counting on you ♡