Added functionality to create scheduled posts (notes and questions only) - #78
Open
savantes1 wants to merge 1 commit into
Open
Added functionality to create scheduled posts (notes and questions only)#78savantes1 wants to merge 1 commit into
savantes1 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds client-side support for Piazza’s scheduled posting workflow by introducing a draft-save RPC call and wiring Network.create_post to optionally create scheduled notes/questions via a draft + content.create request flow.
Changes:
- Add
Rpc.save_draft()wrapper for thenetwork.save_draftendpoint. - Extend
Network.create_post(...)with an optionalscheduled_timeparameter to schedule notes/questions (explicitly not polls). - When
scheduled_timeis provided, create a draft first and submit the post with scheduling config + returned draft reference.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| piazza_api/rpc.py | Adds an RPC helper for saving drafts, used as part of scheduling. |
| piazza_api/network.py | Extends post creation to optionally schedule posts by saving a draft and setting scheduling config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+137
to
+138
| :type scheduled_time: int | None | ||
| :param scheduled_time: The scheduled time to make post as a Unix millisecond timestamp, or None if not scheduled. Note: Does not support poll posts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I recently found myself wanting to be able to utilize the post scheduling feature added last year via the API, so I made a few updates to support the functionality.
For my purposes I only needed the ability to schedule notes and questions (not polls), so those are the only parts I added. Also, it doesn't allow for scheduling posts to specific people. Scheduled posts will be visible to the entire class.
Despite these limitations, I thought my updates might still be useful to others, so I'm putting in the pull request. Maybe someone will build off of what I did to round out the missing pieces ;)