How I Synced Our Class Schedule to Discord

dwnppodwnppo
6 min read

First year of college, and I’m already running late. Is it MATH 1100 or ETHICS? IT Lec or NetSys? I didn’t know—so I built a Discord bot that always would. At first, I made this just for one class, as a simple webhook reminder. But then I thought: why not extend it to the entire BSIT first year?

The goal was simple: turn a Google Calendar into an automated Discord reminder system that pings our class before every subject.

I didn’t want it to be some heavy, overengineered bot. So here’s what I actually built:

  • A Google Calendar that stores all your schedules

  • A simple script that:

    • Fetches events from that calendar

    • Checks which ones are coming up

    • Sends reminders to Discord using a webhook

It runs every 5 minutes using a scheduled task (I’ll show you how). You don’t need a full Discord bot for this—you just need a Webhook URL, a shared calendar, and a script that bridges them.

Here’s the webhook in action, and what you’d be creating.

Snippet of the Discord Webhook, and what you'd be creating.


Setting up the calendar (a.k.a. the most tedious part)

Let’s start with the most tedious part, adding your schedule to Google Calendar.

Use your school account (Google Workspace) if you can—it has higher limits for automation later. More on that below.

  1. Head over to Google Calendar.

  2. Click + CreateEvent.

  3. For each subject, fill in the subject code or name, set the correct time and date, and use the Location field for the building or room where the class is held.

  4. Then—and this is important—make sure to set it to repeat weekly, unless it’s a one-time session.

  5. Then repeat. And repeat. And repeat. Until you’re done with the schedule—literally or emotionally.

Setting up the script

Now that your calendar’s filled with every class, room, let’s automate it.

We’ll use Google Apps Script, which means:

  • No installation needed

  • Runs in the cloud (no always-on laptop or janky Pi needed)

  • Works natively with Google Calendar

  • Sends Discord reminders via a simple webhook

What you’ll need:

The script will:

  • Fetch events from your calendar

  • Check which ones are starting soon

  • Ping the corresponding Discord role with a heads-up

The script:

This version supports multiple blocks or sections (like 1-1, 1-2, etc.), each with their own calendar and role. I originally made a single-class version, but instead of having multiple instances of the script at multiple accounts, I just created a unified calendar reminder for the entire year.

⚠️ You'll need each class’s Google Calendar ID and their corresponding Discord role ID for the mentions to work.

Make sure to save it by pressing Ctrl + S.

Setting up the triggers

Normally, you have to click “Run” everytime you want to run the script, which defeats the entire "automatic” stuff.

Creating the first trigger:

  • In the Apps Script editor, click the clock icon on the left panel (this is the Triggers tab).

  • Click + Add Trigger.

  • For Choose which function to run, select notifyUpcomingClassesToDiscord.

  • For Select event source, pick Time-driven.

  • Then, choose how often you want the script to run.
    I suggest every 5 minutes (under “Minutes timer”) so it catches upcoming classes in time.*

*Note: Google Apps Script has a daily quota on how often a script can run. Free accounts get fewer executions per day compared to Workspace (school/org) accounts. If you're running into issues with missed reminders, you might need to either reduce the frequency or use a Workspace account to increase your limits.

Create the second trigger (to reset daily reminders):

  • Click + Add Trigger again.

  • Select clearOldNotifications for Choose which function to run.

  • Pick Day Timer for the Select type of time based trigger.

  • Finally, select Midnight to 1am on Select time of day.

And that’s it: the schedule is on the calendar, the script is wired to the webhook, and your Discord server now knows where you’re supposed to be better than you do. You can let it run quietly in the background, automatically reminding your entire block where to go next. No more “ano’ng subject susunod?” or “nasaan kayo?” in the group chat.


If you want to tweak the behavior or fix bugs you might run into, check out the FAQ below:

FAQ

Q: I want the notification to be 10 minutes before the class instead of 15. How do I change that?
Go to this part of the script:

const windowStart = new Date(now.getTime() + 15 * 60 * 1000);
const windowEnd = new Date(now.getTime() + 20 * 60 * 1000);

Change the 15 and 20 to whatever window you want. For example:

  • 10 and 15 = checks for events starting in 10 to 15 minutes.

  • 20 and 25 = checks for events starting in 20 to 25 minutes.

Just make sure the difference between them is about 5 minutes so it doesn’t spam multiple notifications.

Q: Why does it only send one notification even if the script runs every 5 minutes?
That’s on purpose. The script remembers what it already sent per event per day, using ScriptProperties. So no matter how many times it runs, it won't resend the same reminder unless you clear it manually (or wait for it to reset the next day).

Q: Why didn’t it send anything?
Here’s a quick checklist:

  • Did you put the correct calendar ID? (It should look like something@group.calendar.google.com)

  • Did you use a working Discord webhook URL?

  • Did you replace the placeholders like REPLACE_WITH_ROLE_ID_1_2?

  • Is the event actually within 15–20 minutes of now? (Try testing with a class that starts soon.)

  • Did you set up the trigger?

Q: It says that a class will begin in 15 minutes, but its actually 16-19 minutes away. Why?.

That’s normal. It isn’t looking for classes exactly 15 minutes ahead, it looks for classes within a specific time window, in this case, is 15-20 minutes. This buffer will keep the messages reliable, but that means that the messages can come a little early.

If you’d like to adjust the time window, please refer to FAQ #1. But be cautious—making the time window too small (e.g. exactly 15 minutes, or 14-17 minutes) can miss the classes entirely.


Thanks for reading! This little tool started as something for my class, but if it helps make your semester a little less chaotic too, then it’s already done its job.

1
Subscribe to my newsletter

Read articles from dwnppo directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

dwnppo
dwnppo