System requirements
Node.js version
Original target: Node.js v14–16 (for discord.js v12)Recommended for modern use: Node.js v18+ with migration to discord.js v14+
Package manager
You’ll need either:- npm (comes with Node.js)
- yarn (alternative package manager)
Optional: MongoDB
MongoDB is required only if you plan to use persistence features like:- Guild configuration storage
- User data tracking
- Token management
- Custom settings per server
- Local installation (MongoDB Community Server)
- Cloud hosting (MongoDB Atlas - free tier available)
- Docker container:
docker run -d -p 27017:27017 mongo
Discord application setup
Before installing Yato, you need a Discord Bot Application:Create a Discord Application
- Go to the Discord Developer Portal
- Click New Application
- Give it a name (e.g., “Yato”)
- Click Create
Create a bot user
- Navigate to the Bot tab in the left sidebar
- Click Add Bot
- Confirm by clicking Yes, do it!
Get your bot token
- Under the Bot tab, find the Token section
- Click Reset Token (or Copy if it’s your first time)
- Save this token securely - you’ll need it for your
.envfile
Enable privileged intents
Under the Bot tab, scroll to Privileged Gateway Intents and enable:
- Server Members Intent (required for member tracking)
- Message Content Intent (required for message-based commands)
- Presence Intent (optional, for member status features)
Installation steps
1. Clone the repository
Clone Yato from GitHub:2. Install dependencies
Install all required npm packages:| Package | Version | Purpose |
|---|---|---|
| discord.js | ^12.5.3 | Discord API wrapper |
| gcommands | ^5.2.4 | Slash command framework |
| mongoose | ^5.12.12 | MongoDB ODM |
| canvas | ^2.8.0 | Image generation |
| anilist-node | ^1.9.0 | AniList API wrapper |
| jikan-node | ^1.2.1 | MyAnimeList API wrapper |
| gamedig | ^3.0.5 | Game server queries |
| dotenv | ^9.0.2 | Environment variable loader |
| moment | ^2.29.1 | Date/time formatting |
| axios | ^0.21.1 | HTTP client |
You may see deprecation warnings or security vulnerabilities due to outdated packages. This is expected for an archived project.
3. System dependencies for Canvas
Thecanvas package requires system-level libraries:
4. Configure environment variables
Create a.env file in the project root directory:
.env
5. Verify installation
Check that everything is set up correctly:Running the bot
Development mode
For development with automatic restarts on file changes:nodemon to watch for changes and restart automatically.
Production mode
For production deployment:Using process managers
For production environments, use a process manager to keep the bot running:Verify bot is running
When Yato starts successfully, you should see:Invite bot to your server
Generate an OAuth2 invite URL:Open URL Generator
In the Discord Developer Portal, select your application and go to OAuth2 → URL Generator
Select permissions
Choose permissions based on features you’ll use:Recommended minimum:
- Read Messages/View Channels
- Send Messages
- Embed Links
- Attach Files
- Read Message History
- Use Slash Commands
- Kick Members
- Ban Members
- Manage Roles
- Manage Messages
- Manage Channels
- Connect
- Speak
Post-installation
Test the bot
Try these commands in your Discord server:Monitor logs
Watch the console output for:- Command registrations
- Error messages
- Database connection status
- User interactions
Security checklist
- ✅
.envis in.gitignore - ✅ Bot token is never committed to git
- ✅ Elevated commands restricted to admin roles
- ✅ Using environment variables for all secrets
- ✅ Rate limiting configured for API calls
Next steps
Configuration
Customize bot behavior and configure features
Commands
Explore all available commands
Development
Learn how to extend Yato with custom commands
Deployment
Deploy Yato to production hosting
Troubleshooting
Common installation issues
npm install fails with Canvas errors
npm install fails with Canvas errors
The macOS:See the node-canvas documentation for more details.
canvas package requires system dependencies. Install them first:Ubuntu/Debian:Error: Cannot find module 'dotenv'
Error: Cannot find module 'dotenv'
Dependencies weren’t installed properly. Run:
Bot token is invalid
Bot token is invalid
- Verify you copied the complete token from Discord Developer Portal
- Check for extra spaces or newlines in your
.envfile - Regenerate the token if you suspect it was compromised
MongoDB connection timeout
MongoDB connection timeout
- Verify your MongoDB instance is running
- Check the
MONGO_URIformat is correct - For MongoDB Atlas, ensure your IP is whitelisted
- Test connection:
mongo "your_connection_string"
Slash commands not appearing
Slash commands not appearing
- Global slash commands can take up to 1 hour to propagate
- Set
GUILD_IDin.envfor instant registration in a test server - Restart the bot after changing command files
- Check bot permissions include “Use Application Commands”
Permission denied errors
Permission denied errors
The bot lacks necessary permissions in your Discord server:
- Re-invite the bot with correct permissions
- Check role hierarchy (bot’s role must be above roles it manages)
- Verify channel-specific permissions
Getting help
If you encounter issues not covered here:- Check the GitHub repository issues
- Join the Yato Support Server
- Review discord.js documentation for API-related questions