RA
Ramzy AymanSoftware Engineer
Completed2025Bot & Backend Architecture

Kaszinó

A modern Discord economy and gambling bot built with Node.js, discord.js v14, and SQLite database persistence.

Project Overview

Kaszinó is a feature-packed Discord economy bot created for community engagement. It implements a complete virtual economy with jobs, begging, player-to-player transfers, interactive gambling minigames (such as Mines and Coinflip), server leaderboards, and administrative controls with atomic SQLite transactions.

Architecture & Technical Highlights

  • [01]Event-driven command handler and interaction router implementing discord.js v14 slash commands and interactive button components.
  • [02]Persistent relational database layer utilizing SQLite via better-sqlite3 with WAL (Write-Ahead Logging) mode for fast, atomic balance transactions.
  • [03]Dynamic board generation and mathematical multiplier scaling algorithm for the interactive Mines minigame.
  • [04]Command cooldown engine tracking timed actions (/work every 12h, /beg every 8h) with timestamp validation.
  • [05]Restricted owner administrative command dispatcher supporting user ID and mention-based balance management.

Engineering Challenges & Solutions

Challenges Encountered

  • Preventing race conditions and balance duplication during rapid concurrent player commands.
  • Managing interactive Discord message button states and component collectors for live game sessions.

Implemented Solutions

  • Implemented synchronous, transaction-wrapped database operations with better-sqlite3 to guarantee balance integrity.
  • Designed dedicated game session handlers with automatic expiration timeouts and single-user interaction locks.

Key Takeaways & Lessons Learned

  • Strengthened database schema design and transactional state management in Node.js.
  • Mastered discord.js v14 event-driven architecture and asynchronous lifecycle management.

Visual Artifacts & Diagrams

Kaszinó Discord Bot Preview
// 01Kaszinó - Discord economy interface, Mines minigame grid, and SQLite architecture