Google Calendar and Gmail Integration Options¶
Goal¶
Get Google Calendar events and Gmail summaries into Discord (or another local system) so Crafty can see what is happening without manual copy-paste.
Option 1: Google Apps Script + Discord Webhook (Recommended)¶
This is free, runs entirely on Google's servers, and requires no third-party service.
How It Works¶
A small script runs on a timer inside your Google account. It checks for upcoming calendar events and recent emails, then posts a summary to a Discord channel via webhook.
Step-by-Step Setup¶
A. Create the Discord Webhook
- Open Discord, go to the target channel's settings (gear icon).
- Click Integrations > Webhooks > New Webhook.
- Name it (e.g., "Google Sync"), copy the webhook URL.
B. Create the Apps Script Project
- Go to https://script.google.com and click New Project.
- Name it something like "Discord Google Sync".
- Paste the following code (two functions: one for Calendar, one for Gmail).
// -- Configuration --
var WEBHOOK_URL = "YOUR_DISCORD_WEBHOOK_URL";
// -- Calendar: post today's events --
function postCalendarEvents() {
var cal = CalendarApp.getDefaultCalendar();
var now = new Date();
var endOfDay = new Date(now);
endOfDay.setHours(23, 59, 59);
var events = cal.getEvents(now, endOfDay);
if (events.length === 0) return;
var lines = events.map(function(e) {
var start = Utilities.formatDate(e.getStartTime(), Session.getScriptTimeZone(), "h:mm a");
return "**" + start + "** - " + e.getTitle();
});
var payload = {
content: "**Calendar today:**\n" + lines.join("\n")
};
UrlFetchApp.fetch(WEBHOOK_URL, {
method: "post",
contentType: "application/json",
payload: JSON.stringify(payload)
});
}
// -- Gmail: post unread email summary --
function postEmailSummary() {
var threads = GmailApp.search("is:unread", 0, 10);
if (threads.length === 0) return;
var lines = threads.map(function(t) {
return "- **" + t.getMessages()[0].getFrom() + "**: " + t.getFirstMessageSubject();
});
var payload = {
content: "**Unread emails (" + threads.length + "):**\n" + lines.join("\n")
};
UrlFetchApp.fetch(WEBHOOK_URL, {
method: "post",
contentType: "application/json",
payload: JSON.stringify(payload)
});
}
- Replace
YOUR_DISCORD_WEBHOOK_URLwith the actual URL.
C. Set Up Triggers (Automatic Scheduling)
- In the Apps Script editor, click the clock icon (Triggers) on the left sidebar.
- Click "Add Trigger".
- For
postCalendarEvents: set to run daily, or every hour, depending on how often you want updates. - For
postEmailSummary: set to run every 15 or 30 minutes. - On first run, Google will ask you to authorize the script. Accept the permissions.
D. Test It
- Click the play button next to
postCalendarEventsto run it manually. - Check your Discord channel for the message.
Permissions Needed¶
CalendarApp-- read access to your Google CalendarGmailApp-- read access to your GmailUrlFetchApp-- ability to make HTTP requests (to the webhook)
Google will show a scary "This app isn't verified" warning since you wrote it yourself. This is normal for personal scripts. Click "Advanced" then "Go to [project name]" to proceed.
Security Considerations¶
- The webhook URL is a secret. Anyone with it can post to your channel. Keep it in the script only.
- The script runs under your Google account. It can read all your email and calendar. Only you have access to it.
- Apps Script projects are private by default. Do not share the project or publish it as a web app.
- If you store the webhook URL in Script Properties instead of hardcoded, it is slightly more secure:
PropertiesService.getScriptProperties().getProperty('WEBHOOK_URL').
Limitations¶
- Apps Script triggers have a minimum interval of 1 minute, but time-driven triggers are typically 1, 5, 10, 15, or 30 minutes, or hourly.
- Gmail quota: free accounts can read up to ~20,000 emails/day via Apps Script (not a concern at normal volumes).
- Discord webhooks have a rate limit of 30 messages per 60 seconds per channel.
Option 2: Zapier (Easiest, Costs Money at Scale)¶
Zapier has pre-built templates for Google Calendar to Discord and Gmail to Discord.
What It Does¶
- "When a new Google Calendar event is created, post to Discord channel"
- "When a new email arrives in Gmail, post a summary to Discord"
Setup¶
- Create a Zapier account at zapier.com.
- Search for "Google Calendar + Discord" or "Gmail + Discord".
- Pick a template (e.g., "Send new Google Calendar events to Discord channels").
- Connect your Google account and your Discord server.
- Map the fields (event title, time, etc.) to the Discord message format.
- Turn it on.
Cost¶
- Free tier: 100 tasks/month, 5 Zaps. Enough for light calendar use but Gmail notifications will burn through it fast.
- Starter: $19.99/month for 750 tasks.
- For a single person's calendar and email summary, free tier might work if you limit frequency.
Pros and Cons¶
- Pro: No code, 5-minute setup, reliable.
- Con: Free tier is limited. Adds a dependency on a third-party service. Less customizable than Apps Script.
Option 3: Make.com (Middle Ground)¶
Similar to Zapier but with a more generous free tier.
Cost¶
- Free tier: 1,000 operations/month. More generous than Zapier.
- Core plan: $9/month for 10,000 operations.
Setup¶
Same concept as Zapier. Create a scenario with Google Calendar or Gmail as trigger, Discord as action.
Recommendation¶
Use Google Apps Script. Here is why:
- Free, no task limits, no third-party dependency.
- Takes about 20 minutes to set up.
- Fully customizable. You can adjust the message format, add filtering (e.g., only post emails from specific senders), or add new data sources later.
- Runs on Google's infrastructure with no maintenance needed.
If you want something running in under 5 minutes and do not mind paying later, Zapier is fine as a stopgap. But for a system Crafty will rely on long-term, Apps Script is the right call.
Next Steps¶
- Create the Discord webhook in your Game1 server (a dedicated #google-sync channel).
- Copy the Apps Script code above and deploy it.
- Set triggers: calendar daily at 7 AM, email every 30 minutes.
- Once working, Crafty can read those Discord messages as context for daily operations.