Skip to content

Added functionality to create scheduled posts (notes and questions only) - #78

Open
savantes1 wants to merge 1 commit into
hfaran:developfrom
savantes1:develop
Open

Added functionality to create scheduled posts (notes and questions only)#78
savantes1 wants to merge 1 commit into
hfaran:developfrom
savantes1:develop

Conversation

@savantes1

Copy link
Copy Markdown
Contributor

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 ;)

Copilot AI review requested due to automatic review settings July 26, 2026 23:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 the network.save_draft endpoint.
  • Extend Network.create_post(...) with an optional scheduled_time parameter to schedule notes/questions (explicitly not polls).
  • When scheduled_time is 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 thread piazza_api/network.py
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants