Add methods to write posts and polls
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
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?
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.
@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.
@amaurylekens or @Olen do you plan to progress this?
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.