Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add methods to write posts and polls #38

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

amaurylekens
Copy link
Contributor

Add two methods:

  • write_post: allows to write a post on the main page of one of the group of the user
  • write_poll: allows to write a poll on the main page of one of the group of the user

@elliot-100 elliot-100 requested a review from Olen October 22, 2022 14:06
@Olen
Copy link
Owner

Olen commented Nov 20, 2022

Sorry, did not see this review-request.
The code looks clean, but I have not had time to test it.

One question (not directly related to this PR) was wether we should start doing more error checking on the "write" operations, as I see there are more coming in.
Today we just return the json() of the request blindly, and hope that any errors or exceptions are triggered in the other libraries, and that all users of the functions will validate the resultng dict.

We could (should?) start validating the results from functions lke these two, and also send_message() (and "write_event" or whatever it will be called if #39 is added.

Another question is if the prefix "write" is the best.
Today we have buch of get_... functions, and a send_message().
If we implement more write-functions, should they also have a common prefix (like e.g. "create_" or "add_")

  • create_post, create_poll, create_message, create_event ...

Or is it better to have more "natural language" with send message, write post add event?

Copy link
Owner

@Olen Olen left a comment

Choose a reason for hiding this comment

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

I am ok with the changes, but please see my general comment to the PR regarding naming av validation of write-requests.

@elliot-100 elliot-100 changed the title Add features Add methods to write posts and polls Jan 5, 2023
@elliot-100 elliot-100 marked this pull request as draft January 5, 2023 13:59
@elliot-100
Copy link
Collaborator

On the naming issue, I have a slight preference for using "create_" consistently.

I've put this back to 'draft' status as it seems to need more thought.

@mittlc
Copy link

mittlc commented Mar 13, 2023

@amaurylekens In the process of creating a post - did you investigate the option to add an attachment to this post by first posting a file towards the route /storage/upload and then use this resulting media as an attachment in the post to be created?

Creating a post is quite straight forward, but the usage of /storage/upload unfortunately is not.

@elliot-100
Copy link
Collaborator

@amaurylekens or @Olen do you plan to progress this?

@Olen
Copy link
Owner

Olen commented Jul 28, 2023

I have no immediate plans to work on this, but if the PR is updated and aligned with the rest of the changes that have been suggested and implemented lately, I obviously don't have any objections to the intent of the PR.

@elliot-100 elliot-100 added the enhancement New feature or request label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants