Skip to content

Latest commit

 

History

History
194 lines (151 loc) · 6.75 KB

File metadata and controls

194 lines (151 loc) · 6.75 KB

🎨 Name That Artist - Project Summary

✅ Implementation Complete

This Discord bot foundation has been successfully set up for The Tezos Community (TTC) "Name That Artist" game.

📦 What Was Built

Core Infrastructure

  • ✅ Node.js project initialized with proper package.json
  • ✅ Discord.js v14.23.2 installed (latest stable version)
  • ✅ Environment-based configuration system
  • ✅ Modular code structure for easy maintenance

Bot Features

  • ✅ Discord bot with proper intents and button interactions
  • ✅ Slash command system (/namethatartist, /leaderboard, /stats, /stopgame, /ping, /help)
  • ✅ Button-based game interaction (click A/B/C/D buttons)
  • ✅ Multi-channel game support (one game per channel)
  • ✅ objkt.com GraphQL API integration
  • ✅ Permission-based game control (starter or moderators can stop games)

Game Logic

  • ✅ Multi-round gameplay (10 rounds per game)
  • ✅ Multiple-choice system (1 correct + 3 distractors)
  • ✅ Timed rounds (15 seconds per round)
  • ✅ Speed-based scoring (100 × time_remaining / total_time)
  • ✅ Real NFT data from TTC wallet (tz1RZN17j7FuPtDpGpXKgMXbx57WEhpZGF6B)
  • ✅ Token caching system (24-hour refresh)
  • ✅ Automatic round progression and game end handling

TTC Branding

  • ✅ Custom bot name: "Name That Artist - TTC Edition"
  • ✅ The Tezos Community branding throughout
  • ✅ Tezos blue color scheme (0x2C7DF6)
  • ✅ Community-focused messaging and UI

Documentation

  • ✅ README.md - Main project overview and quick start
  • ✅ SETUP.md - Detailed setup instructions with screenshots guidance
  • ✅ CONTRIBUTING.md - Contribution guidelines and code standards
  • ✅ examples/artists-example.js - Template for adding artist data

📁 Project Structure

Name-That-Artist/
├── index.js                    # Main bot entry point
├── game.js                     # Game logic and session management
├── config.js                   # Configuration and environment variables
├── deploy-commands.js          # Slash command registration
├── package.json                # Dependencies and scripts
├── .env.example               # Environment variable template
├── README.md                  # Main documentation
├── SETUP.md                   # Setup instructions
├── CONTRIBUTING.md            # Contribution guidelines
├── PROJECT_SUMMARY.md         # This file
└── examples/
    └── artists-example.js     # Artist data template

Dependencies:
├── discord.js@14.23.2         # Discord API wrapper
└── dotenv@16.6.1              # Environment variables

🚀 Quick Start Commands

# Install dependencies
npm install

# Configure bot (edit .env with your Discord credentials)
cp .env.example .env
# Add your DISCORD_TOKEN and CLIENT_ID

# Deploy slash commands to Discord
npm run deploy-commands

# Start the bot (will auto-fetch NFT data on first run)
npm start

# Or run in development mode (auto-restart)
npm run dev

Note: On first run, the bot will fetch all NFTs from the TTC wallet via objkt.com API. This takes 1-2 minutes. Subsequent runs will use cached data.

🎮 Available Commands

Command Description
/namethatartist Start a new game (10 rounds of NFT trivia)
/leaderboard View top 10 players by total score
/stats View your personal statistics
/stopgame Stop the current game (starter or moderator only)
/ping Check bot responsiveness
/help Display help information

🔧 Technology Stack

  • Runtime: Node.js v20+ (Bun compatible)
  • Discord API: Discord.js v14 with button interactions
  • Data Source: objkt.com GraphQL API
  • GraphQL Client: graphql-request v6
  • Storage: Local JSON files (no database required)
  • Configuration: dotenv for environment variables
  • Module System: ES6 modules (type: "module")

📝 Next Steps

To Make It Production-Ready:

  1. Get Discord Credentials

  2. Deploy Commands

    • Run npm run deploy-commands
    • This registers slash commands with Discord
  3. Invite Bot to Server

    • Use the OAuth2 URL Generator in Discord Developer Portal
    • Select scopes: bot, applications.commands
    • Select permissions: Send Messages, Embed Links, etc.
  4. Start the Bot

    • Run npm start
    • Bot will automatically fetch NFT data from TTC wallet (first run only)
    • Try /namethatartist to start a game
    • Use /leaderboard to see top players

Future Enhancements (Optional):

  • 🗄️ Database migration (PostgreSQL/MongoDB) for scalability
  • 🎨 Category filters (art style, medium, date range)
  • 🌐 Multi-server leaderboards
  • 🎁 Role rewards for top players
  • 📱 Improved mobile button layout
  • 🔊 Voice channel integration
  • 🎯 Custom game modes (speed round, sudden death)
  • 🌍 Multi-language support
  • 📈 Advanced analytics dashboard

🔒 Security Notes

  • ✅ No vulnerabilities found in dependencies
  • ✅ Environment variables properly configured
  • .env file excluded from git
  • ✅ Token validation on startup
  • ✅ Proper permission checks for game management

📊 Code Quality

  • ✅ All JavaScript files are syntactically valid
  • ✅ ES6+ modern JavaScript syntax
  • ✅ Modular architecture (separation of concerns)
  • ✅ Error handling and validation
  • ✅ Graceful shutdown handlers
  • ✅ Comprehensive comments

🤝 Contributing

This project welcomes contributions! See CONTRIBUTING.md for:

  • Code style guidelines
  • How to add new features
  • How to add new commands
  • How to add artist data
  • Pull request process

📞 Support

  • 📖 Check README.md for overview
  • 🛠️ See SETUP.md for setup help
  • 🐛 Report issues on GitHub
  • 💬 Ask questions in The Tezos Community

🎉 Success Criteria Met

Node/Bun/Discord.js stack: Fully implemented with Node.js and Discord.js v14
Discord app foundation: Complete bot infrastructure with button interactions
objkt.com integration: GraphQL API fetching with pagination and caching
Multi-round gameplay: 10 rounds with timed, multiple-choice questions
Scoring system: Speed-based scoring (100 × time_remaining / total_time)
Leaderboard & stats: Persistent JSON storage with player tracking
TTC branding: The Tezos Community branding throughout
Real NFT data: Pulls from TTC wallet (tz1RZN17j7FuPtDpGpXKgMXbx57WEhpZGF6B)
Documentation: Comprehensive guides for setup and usage


Status: ✅ COMPLETE - Production-ready with all requirements implemented!

Built with ❤️ for The Tezos Community