Everything you need to know about hosting Discord bots on fract.dev. From quick start guides to advanced configuration.
Get your Discord bot deployed in under 5 minutes
npm install -g @fract/clifract loginfract deploy ./my-botExplore our comprehensive guides and references
Ready-to-use code snippets to get you started
# Initialize a new bot project
fract init my-discord-bot
# Configure your bot
cd my-discord-bot
fract config set token YOUR_BOT_TOKEN
# Deploy to production
fract deploy --env production# fract.yml
name: my-discord-bot
runtime: node18
memory: 512MB
env:
NODE_ENV: production
DEBUG: false
scaling:
min: 1
max: 3const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages]
});
client.once('ready', () => {
console.log('Bot is ready!');
});
client.on('messageCreate', message => {
if (message.content === '!ping') {
message.reply('Pong!');
}
});
client.login(process.env.DISCORD_TOKEN);