What you’ll learn
Discord API
Build interactive bot features
Bot Commands
Handle user interactions
Publishing
Host your bot 24/7
Authentication
Manage bot tokens securely
Create your bot
1
Fork the template
Sign in to Replit and fork the Discord bot template. Select + Use Template and follow the prompts to create your Replit App.
2
Set up Discord developer portal
- Go to the Discord Developer Portal
- Navigate to your application’s Bot section
- Under Build-A-Bot, select Reset Token
- Copy the token
Keep your bot token secret! Never share it or commit it to version control.
3
Configure your bot
Add your bot token to your Replit App:
- Open the Secrets tab
- Create a new secret named
DISCORD_BOT_TOKEN
- Paste your bot token as the value
Use Replit Secrets to securely store sensitive information like API tokens.
Publish your bot
1
Set up publishing
- Select Publish in the workspace header
- Choose Reserved VM deployment
- Select Publish
2
Test
- Invite your bot to a server
- Try the
/tell-me-a-joke
command - Verify the bot responds correctly
Reserved VM deployments ensure your bot stays online continuously.
Customization options
Commands
- Add new commands - Create custom responses - Handle different events
Features
- Add moderation tools - Create games - Integrate with APIs
Next steps
Related guides
Want to learn more about bot development? Check out our publishing documentation.