- Overview
- Features
- Tech Stack
- Prerequisites
- Quick Start
- Configuration
- Commands
- Scheduled Messages
- Deployment
- Development
- Troubleshooting
HackOverflow Bot is an intelligent Discord assistant built for the HackOverflow 4.0 hackathon. It combines Discord.js with Groq's free AI API to provide instant answers about the event and schedule automated announcements.
Event Details:
- Date: March 11-13, 2026 (36 hours)
- Location: PHCET Campus, Rasayani, Maharashtra
- Prize Pool: ₹100,000+
- Expected Participants: 250+
- Natural language understanding using Groq's LLaMA 3.3 70B model
- Instant answers about hackathon details, registration, and schedule
- Context-aware responses from
hackathon-data.json - Rate limiting: 1 query per 5 seconds per user
ho!help- Show help guideho!schedule- View 3-day event timelineho!faq- Frequently asked questionsho!team- Meet the organizing teamho!register- Registration informationho!stats- Event statisticsho!about- About HackOverflow 4.0
- Daily morning reminders (9:00 AM)
- Weekly updates (Mondays 10:00 AM)
- Registration deadline warnings
- Event day announcements
- All messages pull data from
hackathon-data.json
| Technology | Purpose |
|---|---|
| TypeScript | Type-safe development |
| Discord.js v14 | Discord API interaction |
| Groq SDK | Free AI completions |
| Node-cron | Scheduled messages |
| Docker | Containerization |
- Node.js 18.0.0 or higher
- npm or yarn
- Discord Bot Token
- Groq API Key (free at console.groq.com)
- Docker (optional, for deployment)
git clone https://github.com/YOUR_USERNAME/hackoverflow-bot.git
cd hackoverflow-botnpm installcp .env.example .envEdit .env and add:
DISCORD_BOT_TOKEN=your_discord_bot_token
GROQ_API_KEY=your_groq_api_key
ANNOUNCEMENTS_CHANNEL_ID=your_channel_id
NODE_ENV=development# Development mode
npm run dev
# Production
npm run build
npm start- Go to Discord Developer Portal
- Select your application → OAuth2 → URL Generator
- Select scopes:
bot,applications.commands - Select permissions:
Send Messages,Embed Links,Read Message History - Copy URL and authorize bot to your server
- Go to Discord Developer Portal
- Create New Application → Name it "HackOverflow Bot"
- Go to Bot tab → Reset Token → Copy token
- Enable Privileged Gateway Intents:
- Presence Intent
- Server Members Intent
- Message Content Intent
- Paste token in
.envfile
- Go to console.groq.com
- Sign up (free)
- Create API key
- Paste in
.envfile
Groq Free Tier:
- 30 requests/minute
- 14,400 requests/day
- No credit card required
- Enable Developer Mode in Discord
- Right-click the announcements channel
- Copy Channel ID
- Paste in
ANNOUNCEMENTS_CHANNEL_ID
All commands use the ho! prefix to avoid conflicts with other bots.
| Command | Description |
|---|---|
ho!help |
Show all commands and features |
ho!schedule |
View 3-day event timeline |
ho!faq |
Common questions and answers |
ho!team |
Meet organizing team |
ho!register |
Registration details |
ho!stats |
Event statistics |
ho!about |
About HackOverflow 4.0 |
Mention the bot with your question:
@HackOverflow Bot when is the hackathon?
@HackOverflow Bot how do I register?
@HackOverflow Bot what's the prize pool?
Rate Limit: 1 question per 5 seconds per user
Automatic announcements sent to configured channel. All messages dynamically pull data from hackathon-data.json.
| Schedule | Time | Description |
|---|---|---|
| Daily | 9:00 AM | Morning reminder |
| Weekly | Monday 10:00 AM | Weekly update |
| 7 days before registration | 6:00 PM | Deadline warning |
| Registration deadline day | 9:00 AM, 6:00 PM | Final reminders |
| Day before event | 6:00 PM | Event prep reminder |
| Event day | 8:00 AM | Kickoff announcement |
Edit src/utils/scheduler.ts:
{
cronExpression: '0 9 * * *', // Every day at 9 AM
channelId: process.env.ANNOUNCEMENTS_CHANNEL_ID || '',
description: 'Daily morning reminder',
message: () => {
const { name, dates, statistics } = hackathonData;
return new EmbedBuilder()
.setColor('#FF6B35')
.setTitle('Good Morning, Hackers!')
.setDescription(`${name} is coming soon!`)
.addFields(
{ name: 'Event Dates', value: `${dates.event_start} - ${dates.event_end}` }
);
}
}Cron Syntax:
* * * * *
│ │ │ │ │
│ │ │ │ └─ Day of week (0-7)
│ │ │ └─── Month (1-12)
│ │ └───── Day of month (1-31)
│ └─────── Hour (0-23)
└───────── Minute (0-59)
npm run build
npm install -g pm2
pm2 start dist/index.js --name hackoverflow-bot
pm2 save
pm2 startup# Build image
docker build -t hackoverflow-bot .
# Run container
docker run -d \
--name hackoverflow-bot \
--env-file .env \
--restart unless-stopped \
hackoverflow-bot# Start
docker-compose up -d
# View logs
docker-compose logs -f hackoverflow-bot
# Stop
docker-compose down- Push to GitHub
- In Coolify Dashboard: New Resource → Docker Compose
- Connect repository
- Set compose file:
docker-compose.coolify.yml - Add environment variables
- Deploy
npm install
npm run devhackoverflow-bot/
├── src/
│ ├── config/
│ │ └── hackathon-data.json # Event data
│ ├── utils/
│ │ ├── llm.ts # Groq AI integration
│ │ └── scheduler.ts # Cron jobs
│ ├── index.ts # Main bot logic
│ └── test-env.ts # Environment validator
├── dist/ # Compiled JavaScript
├── .env # Environment variables
├── .env.example # Template
├── package.json
├── tsconfig.json
├── Dockerfile
└── docker-compose.yml
Edit src/index.ts:
async function handleYourCommand(message: Message): Promise<void> {
const embed = new EmbedBuilder()
.setColor('#FF6B35')
.setTitle('Your Command Title')
.setDescription('Your description');
await message.reply({ embeds: [embed] });
}
// Add to switch statement
case 'yourcommand':
await handleYourCommand(message);
break;Edit src/config/hackathon-data.json:
{
"name": "HackOverflow 4.0",
"dates": {
"event_start": "March 11, 2026",
"event_end": "March 13, 2026"
},
"statistics": {
"prize_pool": "₹100,000+",
"expected_hackers": "250+"
}
}Updates to this file automatically reflect in:
- AI responses
- Scheduled messages
- Command outputs
Check if bot is running:
ps aux | grep node
# or
docker-compose logs -f hackoverflow-bot- Verify
DISCORD_BOT_TOKENin.env - Remove extra spaces
- Regenerate token if needed
401 Unauthorized:
- Check
GROQ_API_KEYis correct - Verify at console.groq.com
429 Rate Limited:
- Wait 1 minute and try again
- Users are rate-limited to 1 query per 5 seconds
- Free tier: 30 requests/minute
- Verify
Message Content Intentis enabled - Check bot has channel permissions:
- Send Messages
- Embed Links
- Read Message History
- Set
ANNOUNCEMENTS_CHANNEL_IDin.env - Verify bot has permissions in that channel
- Check cron expressions in
src/utils/scheduler.ts - Ensure
hackathon-data.jsonis valid JSON
Clean build:
rm -rf dist node_modules
npm install
npm run buildCheck destructuring from hackathon-data.json:
// Wrong - expected_hackers is not at top level
const { name, expected_hackers } = hackathonData;
// Correct - access from statistics object
const { name, statistics } = hackathonData;
// Then use: statistics.expected_hackersResource Usage:
- RAM: ~100-150 MB
- CPU: <1% idle
- Network: ~1-5 MB/day
Groq API Limits (Free Tier):
- 30 requests/minute
- 14,400 requests/day