How to Add a Daily Quote Bot to Your Discord Server
Why Daily Quotes Belong in Your Discord Server
Discord servers live and die by engagement. Whether you run a developer community, a study group, or a gaming guild, keeping members active between major events is a constant challenge. A discord quote bot solves this elegantly: every morning, a fresh inspirational or motivational quote appears in a dedicated channel, sparking reactions, replies, and a sense of shared culture.
Beyond engagement, daily quotes set a tone. Teams that start their day with a well-chosen thought tend to feel more cohesive. The automation means zero manual effort once the bot is deployed — it just works, day after day.
What You'll Need Before You Start
This guide assumes you have basic familiarity with Node.js and the Discord developer portal. Here's the full checklist:
Tools and accounts required:
- A Discord account with server admin permissions
- Node.js 18+ installed locally
- A Discord application and bot token (created at
discord.com/developers) - A QOD API key from qod.io
- The
discord.jsv14 library
The QOD API returns a structured JSON object containing the quote text, author name, category, and the canonical date — everything you need to build a rich, formatted message embed.
Setting Up Your Discord Bot Application
Head to the Discord Developer Portal and create a new application. Under the "Bot" tab, generate a token and copy it somewhere safe — you'll never see it again after leaving that page. Enable the Message Content Intent and Server Members Intent under Privileged Gateway Intents.
Generate an invite URL under OAuth2 → URL Generator. Select the bot scope and grant the Send Messages and Embed Links permissions. Use that URL to add the bot to your server.
Fetching the Quote of the Day from the QOD API
The QOD API at https://qod.io/api/qod returns today's quote in a clean JSON format. Here's how to fetch it in Node.js:
const fetch = require('node-fetch');
async function getDailyQuote() {
const res = await fetch('https://qod.io/api/qod', {
headers: { 'X-API-Key': process.env.QOD_API_KEY }
});
const data = await res.json();
return data.quote; // { text, author, category }
}
The response includes the quote text, the author's name, and a category tag such as "inspirational" or "motivational." You can use the category to filter quotes if your community prefers a specific tone — for example, a developer community might prefer quotes tagged under "wisdom" or "technology."
Building the Bot with discord.js
With your quote fetch function ready, wire it into a discord.js client that fires on a daily schedule using Node's built-in setInterval or a cron library like node-cron.
const { Client, GatewayIntentBits, EmbedBuilder } = require('discord.js');
const cron = require('node-cron');
const client = new Client({
intents: [GatewayIntentBits.Guilds]
});
client.once('ready', () => {
console.log(`Logged in as ${client.user.tag}`);
// Fire every day at 9:00 AM server time
cron.schedule('0 9 * * *', async () => {
const quote = await getDailyQuote();
const channel = client.channels.cache.get(process.env.CHANNEL_ID);
const embed = new EmbedBuilder()
.setTitle('Quote of the Day')
.setDescription(`*"${quote.text}"*`)
.setFooter({ text: `— ${quote.author} | ${quote.category}` })
.setColor(0x5865F2);
channel.send({ embeds: [embed] });
});
});
client.login(process.env.DISCORD_TOKEN);
Store your DISCORD_TOKEN, QOD_API_KEY, and CHANNEL_ID in a .env file and load them with the dotenv package. Never commit credentials to version control.
#daily-quotes channel and set it to read-only for regular members. This keeps the feed clean and prevents the quote from being buried under replies.
Deploying Your Discord Quote Bot
For a discord quote bot to post reliably every day, it needs to run on a persistent server — not your local machine. Popular free and low-cost options include Railway, Fly.io, and a basic DigitalOcean Droplet. Railway is the fastest path: connect your GitHub repo, add your environment variables in the dashboard, and deploy in under five minutes.
If you prefer serverless, consider a GitHub Actions workflow triggered by a cron schedule that runs a lightweight script, fetches the quote of the day, and posts it via the Discord REST API directly — no long-running process required.
Extending the Bot with Slash Commands
Once the daily automation is working, add a /quote slash command so members can request an inspirational quote on demand at any time. Register the command using Discord's application command API, then handle the interaction inside your client's interactionCreate event. Call getDailyQuote() and respond with the same embed format. Members love the ability to summon a motivational quote mid-conversation — it becomes a natural part of server culture.
You can also add optional category parameters to the slash command, letting users request a quote from a specific theme. The QOD API supports category filtering via query parameters, making this a straightforward extension that adds significant perceived value.