From e6b4537f410f359275f398451c5598a4c30483cf Mon Sep 17 00:00:00 2001 From: TheLuckyman30 Date: Wed, 7 May 2025 03:42:04 -0400 Subject: [PATCH 1/4] Added documentation for calendar command and general implemnatations --- Documentation/Spring 2025 Implementations | 67 ++++++++++++++++++++--- 1 file changed, 60 insertions(+), 7 deletions(-) diff --git a/Documentation/Spring 2025 Implementations b/Documentation/Spring 2025 Implementations index 9312a015..29aea3af 100644 --- a/Documentation/Spring 2025 Implementations +++ b/Documentation/Spring 2025 Implementations @@ -1,10 +1,63 @@ Here is what we got done: -1. /calendar: - -2. /importcalendar: - -3. /calreminder: - Google OAuth flow wired up so users can link their calendar +How to set up google cloud project for Sage (VERY IMPORTANT): + +- Go to https://cloud.google.com/ +- Click Console on the top right hand corner of the page +- Click Create or select a project +- Click New Project on the top right hand of the box that pops up +- Give it a name, organization, location (Note: This may not work with your UDEL account) +- Click Create project +- You should now be in your created project (If not just search google cloud console and click console on the top right corner) +- Click on APIs & Services +- Search for the google calendar api and enable it +- Go back to the APIs & Services page and click on OAuth consent sreen +- Click on Audience and click Get Started +- Give your app a name and provide an email address and then click next +- Select External then click next +- Provide the same email address then click next +- Select I agree and the click continue and then click create +- Navigate back to APIs & Services and click on credentials +- Click on Create credentials and select Service account +- Give your service account a name and click Create and continue +- Select the editor role and then click Done +- You should now be on the service accounts page (If not, navigate to IAM & Admin and click on Service Accounts) +- Click on the service account you just created and click on keys at the top +- Click on add key, create new key, select JSON, and then click create +- The key will be automatically downloaded on your computer +- Rename it credentials.json and add it to the root folder of Sage +- Make sure this line is included in your .env file MYPATH=./credentials.json +- Sage should now have access to the google calendar api and any other google services you desire + + + +General Implementations: + +1. Improved Goolge Authentication + - No longer needs users to be added to a google cloud project + - Works on mobile + - If you skipped the wall of text explaing how to set it up, go back and read it + +2. Pagified Select Menus: + - Select menus in discord are pretty limited (Can only store 25 values) + - To get around this, we made a new class that can automatically generate and pagify a select menu if there are more than 25 values + - For more detailed documentation, go to src/lib/types/PagifiedSelect.ts + + +Commands: + +1. /calendar: Retrieve events from a google calendar and display them to the user (Pre-existing command) + - Can now retrieve from multiple course google calendars through the coursecode argument when using the command + - Events are retrived from the specified google calendar and are formatted into embeds, which have been given a cleaner look + - Users can now download the returned events using the download events button + - Buttons to select and download individual events are also provided + - Improved filtering system to use select menus instead of taking in user arguments + +2. /importcalendar: [description] (New command) + +3. /removecalendar: [description] (New command) + +4. /calreminder: - Google OAuth flow wired up so users can link their calendar (New command) - Events pulled into bot memory via retrieveEvents() @@ -24,7 +77,7 @@ Here is what we got done: - Sends ephemeral DM confirmation with the scheduled time -4. /cancelreminder: +5. /cancelreminder: - “Cancel Reminder” button available after setting a reminder @@ -34,7 +87,7 @@ Here is what we got done: - Basic try/catch around the delete, logs errors to console -5. /viewreminders: +6. /viewreminders: - Fetches all upcoming reminders for the invoking user from MongoDB From 6d30bbfc4a546433e7c36b1d75a2c0c5d2285710 Mon Sep 17 00:00:00 2001 From: TheLuckyman30 Date: Wed, 7 May 2025 12:15:40 -0400 Subject: [PATCH 2/4] Formatted documentation --- Documentation/Spring 2025 Implementations | 51 ++++++++--------------- 1 file changed, 17 insertions(+), 34 deletions(-) diff --git a/Documentation/Spring 2025 Implementations b/Documentation/Spring 2025 Implementations index 29aea3af..67e69e61 100644 --- a/Documentation/Spring 2025 Implementations +++ b/Documentation/Spring 2025 Implementations @@ -58,41 +58,24 @@ Commands: 3. /removecalendar: [description] (New command) 4. /calreminder: - Google OAuth flow wired up so users can link their calendar (New command) - - - Events pulled into bot memory via retrieveEvents() - - - Parsing system extracts summary, start date/time, location, etc. - - - Filter menu lets you pick by course ID, day, date, location (virtual/in-person) - - - UI shows 3 events per page with Next/Prev buttons - - - Offset selector (At event, 10m / 30m / 1h / 1 d before) - - - “Repeat” toggle for per-event reminders (bug documented in code) - - - Builds reminder date, checks against past times - - - Inserts reminder into MongoDB (calreminders collection) - - - Sends ephemeral DM confirmation with the scheduled time + - Events pulled into bot memory via retrieveEvents() + - Parsing system extracts summary, start date/time, location, etc. + - Filter menu lets you pick by course ID, day, date, location (virtual/in-person) + - UI shows 3 events per page with Next/Prev buttons + - Offset selector (At event, 10m / 30m / 1h / 1 d before) + - “Repeat” toggle for per-event reminders (bug documented in code) + - Builds reminder date, checks against past times + - Inserts reminder into MongoDB (calreminders collection) + - Sends ephemeral DM confirmation with the scheduled time 5. /cancelreminder: - - - “Cancel Reminder” button available after setting a reminder - - - Deletes the reminder document from MongoDB - - - Sends an ephemeral DM follow-up: “Your reminder has been canceled.” - - - Basic try/catch around the delete, logs errors to console + - “Cancel Reminder” button available after setting a reminder + - Deletes the reminder document from MongoDB + - Sends an ephemeral DM follow-up: “Your reminder has been canceled.” + - Basic try/catch around the delete, logs errors to console 6. /viewreminders: - - - Fetches all upcoming reminders for the invoking user from MongoDB - - - Displays them in pages of 3 (same paginated UI as /calreminder) - - - Shows event summary, reminder time, and repeat status - - - All output sent as an ephemeral DM for privacy + - Fetches all upcoming reminders for the invoking user from MongoDB + - Displays them in pages of 3 (same paginated UI as /calreminder) + - Shows event summary, reminder time, and repeat status + - All output sent as an ephemeral DM for privacy From fc7ac266813f394e992cb88382efaea2861bf82d Mon Sep 17 00:00:00 2001 From: TheLuckyman30 Date: Wed, 7 May 2025 12:18:08 -0400 Subject: [PATCH 3/4] Added section for tainfo --- Documentation/Spring 2025 Implementations | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Documentation/Spring 2025 Implementations b/Documentation/Spring 2025 Implementations index 67e69e61..302ecec4 100644 --- a/Documentation/Spring 2025 Implementations +++ b/Documentation/Spring 2025 Implementations @@ -1,6 +1,6 @@ Here is what we got done: -How to set up google cloud project for Sage (VERY IMPORTANT): +How to set up a google cloud project for Sage (VERY IMPORTANT): - Go to https://cloud.google.com/ - Click Console on the top right hand corner of the page @@ -46,18 +46,18 @@ General Implementations: Commands: -1. /calendar: Retrieve events from a google calendar and display them to the user (Pre-existing command) +1. /calendar: Retrieve events from a google calendar and display them to the user (Pre-existing command) - Can now retrieve from multiple course google calendars through the coursecode argument when using the command - Events are retrived from the specified google calendar and are formatted into embeds, which have been given a cleaner look - Users can now download the returned events using the download events button - Buttons to select and download individual events are also provided - Improved filtering system to use select menus instead of taking in user arguments -2. /importcalendar: [description] (New command) +2. /importcalendar: [description] (New command) 3. /removecalendar: [description] (New command) -4. /calreminder: - Google OAuth flow wired up so users can link their calendar (New command) +4. /calreminder: - Google OAuth flow wired up so users can link their calendar (New command) - Events pulled into bot memory via retrieveEvents() - Parsing system extracts summary, start date/time, location, etc. - Filter menu lets you pick by course ID, day, date, location (virtual/in-person) @@ -68,14 +68,16 @@ Commands: - Inserts reminder into MongoDB (calreminders collection) - Sends ephemeral DM confirmation with the scheduled time -5. /cancelreminder: +5. /cancelreminder: - “Cancel Reminder” button available after setting a reminder - Deletes the reminder document from MongoDB - Sends an ephemeral DM follow-up: “Your reminder has been canceled.” - Basic try/catch around the delete, logs errors to console -6. /viewreminders: +6. /viewreminders: - Fetches all upcoming reminders for the invoking user from MongoDB - Displays them in pages of 3 (same paginated UI as /calreminder) - Shows event summary, reminder time, and repeat status - All output sent as an ephemeral DM for privacy + +7. /tainfo: [description] (New command) From 11a292fc1313622ba78fe6f0d92f3436d717e57a Mon Sep 17 00:00:00 2001 From: TheLuckyman30 Date: Wed, 7 May 2025 13:15:35 -0400 Subject: [PATCH 4/4] Removed documentation on previous implementations --- Documentation/Spring 2025 Implementations | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Documentation/Spring 2025 Implementations b/Documentation/Spring 2025 Implementations index 302ecec4..21c2182f 100644 --- a/Documentation/Spring 2025 Implementations +++ b/Documentation/Spring 2025 Implementations @@ -67,17 +67,9 @@ Commands: - Builds reminder date, checks against past times - Inserts reminder into MongoDB (calreminders collection) - Sends ephemeral DM confirmation with the scheduled time - -5. /cancelreminder: - “Cancel Reminder” button available after setting a reminder - Deletes the reminder document from MongoDB - Sends an ephemeral DM follow-up: “Your reminder has been canceled.” - Basic try/catch around the delete, logs errors to console -6. /viewreminders: - - Fetches all upcoming reminders for the invoking user from MongoDB - - Displays them in pages of 3 (same paginated UI as /calreminder) - - Shows event summary, reminder time, and repeat status - - All output sent as an ephemeral DM for privacy - -7. /tainfo: [description] (New command) +5. /tainfo: [description] (New command)