A Discord bot that sends a daily morning digest with weather, top news, soccer scores & stats, and your Google Calendar events — plus a command to add calendar events on-the-fly.
| Feature | Command / Trigger |
|---|---|
| ☀️ Morning digest (auto) | Sent every morning at 8 AM |
| 📬 Trigger digest manually | !digest |
| 📅 Add a Google Calendar event | !addevent |
| ❓ Help | !help |
- 🌤️ Weather — temperature, feels like, humidity, wind, sunrise/sunset
- 📰 Top Headlines — 5 news articles with links
- ⚽ Soccer Scores — yesterday's & today's results across your leagues
- 📊 Top Scorers — current Premier League (or your league) goal leaders
- 📅 Google Calendar — all of today's events
- Node.js 18+
- A Discord account
Open folder in an editor of choice
- Go to discord.com/developers/applications
- New Application → give it a name
- Go to Bot → click Reset Token → copy the token
- Under Privileged Gateway Intents, enable:
- ✅ Message Content Intent
- Go to OAuth2 → URL Generator:
- Scopes:
bot - Bot Permissions:
Send Messages,Read Messages/View Channels,Embed Links
- Scopes:
- Copy the generated URL → open it → add the bot to your server
- Enable Developer Mode in Discord settings → right-click your channel → Copy ID
| Service | Free Tier | Link |
|---|---|---|
| Discord | Free | discord.com/developers |
| OpenWeatherMap | 1000 calls/day | openweathermap.org/api |
| NewsAPI | 500 calls/day | newsapi.org/register |
| API-Football | 100 calls/day | rapidapi.com |
cp .env.example .env
# Edit .env with your keys- Go to console.cloud.google.com
- Create a new project
- Enable the Google Calendar API
- Go to Credentials → Create Credentials → OAuth 2.0 Client ID
- Application type: Desktop app
- Download the JSON file → save it as
google-credentials.jsonin the project root - Run the authorization script:
Follow the prompts — a
npm run setup-google
google-token.jsonwill be saved (keep this private!)
npm startIn .env:
MORNING_CRON=0 7 * * * # 7:00 AM
MORNING_CRON=30 8 * * * # 8:30 AM
Cron format: minute hour * * *
SOCCER_LEAGUE_IDS=39,140,2,78
Common IDs: 39=EPL, 140=La Liga, 2=UCL, 78=Bundesliga, 135=Serie A, 61=Ligue 1
NEWS_COUNTRY=us # us, ca, gb, au, etc.
NEWS_CATEGORY=sports # general, sports, technology, business
Use PM2 to keep the bot running:
npm install -g pm2
pm2 start index.js --name morning-bot
pm2 save
pm2 startupOr deploy to a free cloud service like Railway or Render.
discord-morning-bot/
├── index.js # Bot entry point & command handler
├── setup-google.js # One-time Google OAuth setup
├── .env # Your secrets (never commit!)
├── .env.example # Template
├── google-credentials.json # Google OAuth credentials (never commit!)
├── google-token.json # Google access token (auto-generated)
└── services/
├── digest.js # Assembles all embeds for the morning digest
├── weather.js # OpenWeatherMap API
├── news.js # NewsAPI
├── soccer.js # API-Football scores & stats
├── calendar.js # Google Calendar read + create
└── eventHandler.js # !addevent wizard logic
- Never commit
.env,google-credentials.json, orgoogle-token.json - Add them to
.gitignore