Google OAuth — Telegram Bot
For all Google OAuth fundamentals (GCP project, token expiry, multi-account auth, troubleshooting), see the master reference:
→ ~/.claude/skills/google-apps/SKILL.md (Part 1–4)
This doc only covers bot-specific details.
Bot Token Files
Located at /opt/claude-bot/tokens/ on the droplet (174.138.58.154):
| File | Account | Service |
|---|---|---|
work_calendar.json |
eric@grainandmortar.com | Calendar |
work_gmail.json |
eric@grainandmortar.com | Gmail |
personal_gmail.json |
ericbmx@gmail.com | Gmail |
client_secret.json |
— | OAuth client creds |
Both calendars (Work primary + Eric : Personal) are under the work account — only work_calendar.json needed.
Calendar IDs
| Calendar | ID |
|---|---|
| Work (primary) | eric@grainandmortar.com |
| Eric : Personal | grainandmortar.com_qsih6tdd3qrbeq1f2jbm9th3ts@group.calendar.google.com |
Generate + Deploy Tokens
# Generate locally
cd ~/Desktop
python3 generate_tokens.py work calendar
python3 generate_tokens.py work gmail
python3 get_personal_gmail_token.py # incognito flow for ericbmx
# Deploy to droplet
scp ~/Desktop/tokens/*.json root@174.138.58.154:/opt/claude-bot/tokens/
ssh root@174.138.58.154 "chown -R claude-bot:claude-bot /opt/claude-bot/tokens && chmod 600 /opt/claude-bot/tokens/*.json"
ssh root@174.138.58.154 "systemctl restart claude-bot"
Health Check
Send /health to @heyroyalbot — tests all token sets and reports OK/FAILED.
Architecture
/opt/claude-bot/
├── bot.py # Tool definitions + implementations
├── google_auth.py # Token loading, auto-refresh, account resolution
└── tokens/ # OAuth tokens (chmod 600)