This guide will help you set up and run the Name That Artist Discord bot for The Tezos Community.
Before you begin, make sure you have:
- Node.js 18.x or higher installed
- A Discord account
- Access to the Discord Developer Portal
- Go to https://discord.com/developers/applications
- Click "New Application"
- Give it a name (e.g., "Name That Artist - TTC")
- Click "Create"
- In your application, go to the "Bot" section (left sidebar)
- Click "Add Bot" and confirm
- Under "Privileged Gateway Intents", enable:
- ✅ Message Content Intent
- ✅ Server Members Intent (optional, for member counting)
- Click "Save Changes"
- Under "TOKEN", click "Reset Token" and copy it (save it securely!)
- Go to the "General Information" section (left sidebar)
- Copy your "Application ID" (also called Client ID)
-
In the project directory, copy the example environment file:
cp .env.example .env
-
Edit
.envand add your credentials:DISCORD_TOKEN=your_token_from_step_2 CLIENT_ID=your_application_id_from_step_3
npm installBefore the bot can use slash commands, you need to register them with Discord:
npm run deploy-commandsYou should see:
✅ Successfully reloaded application (/) commands.
- Go back to the Discord Developer Portal
- Navigate to "OAuth2" → "URL Generator"
- Select the following scopes:
- ✅
bot - ✅
applications.commands
- ✅
- Select the following bot permissions:
- ✅ Send Messages
- ✅ Send Messages in Threads
- ✅ Embed Links
- ✅ Attach Files
- ✅ Read Message History
- ✅ Add Reactions
- ✅ Use Slash Commands
- Copy the generated URL at the bottom
- Open the URL in your browser
- Select a server and click "Authorize"
npm startYou should see:
╔═══════════════════════════════════════════════════════════╗
║ ║
║ 🎨 Name That Artist - TTC Edition ║
║ The Tezos Community Discord Game ║
║ ║
╚═══════════════════════════════════════════════════════════╝
✅ Logged in as Your Bot Name#1234
🌐 Connected to 1 server(s)
In your Discord server, try these commands:
/help- View all available commands/ping- Check if the bot is responsive/namethatartist- Start a game (fetches real NFTs from TTC wallet!)/leaderboard- View top players/stats- View your personal statistics
Note: On first run, the bot will fetch all NFTs from the TTC wallet. This may take a minute or two. Subsequent runs will use cached data.
- Token Fetching: Bot automatically fetches NFTs from the TTC wallet using objkt.com GraphQL API
- Caching: Tokens are cached in
data/tokens.jsonfor 24 hours - Game Creation: When
/namethatartistis run, the bot selects 10 random NFTs - Round Display: Each round shows an NFT image and 4 artist choices (A/B/C/D)
- Player Interaction: Players click buttons to answer within 15 seconds
- Scoring: Correct answers earn points based on response speed
- Results: After 10 rounds, final scores and winners are announced
The bot stores data locally in JSON files:
data/tokens.json- Cached NFT tokens from the walletdata/players.json- Player statistics and historydata/game_state.json- Active game sessions (for recovery)
These files are automatically created and updated by the bot.
To run the bot with auto-restart on file changes:
npm run devThis is useful when developing new features.
If you have Bun installed:
bun install
bun run index.jsBun provides faster startup times and is fully compatible with this project.
- Make sure you ran
npm run deploy-commands - Check that the bot has proper permissions in your Discord server
- Verify that "Message Content Intent" is enabled in the Discord Developer Portal
- Double-check your
DISCORD_TOKENin the.envfile - Make sure you copied the complete token without extra spaces
- You may need to regenerate the token in the Discord Developer Portal
- Run
npm run deploy-commandsagain - Wait a few minutes for Discord to update (can take up to an hour for global commands)
- Try kicking and re-inviting the bot
For issues or questions:
- Check the main README
- Review Discord.js documentation: https://discord.js.org/
- Open an issue in the GitHub repository
Made with ❤️ for The Tezos Community