From f734a45fb667baf40d2cae3696934f91f1d5d8d0 Mon Sep 17 00:00:00 2001 From: Erin Congden Date: Sun, 2 Apr 2017 18:46:43 -0700 Subject: Added spoiler text support --- docs/index.rst | 3 ++- mastodon/Mastodon.py | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 121dc83..39af190 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -108,7 +108,7 @@ Toot dicts mastodon.toot("Hello from Python") # Returns the following dictionary: { - 'sensitive': Denotes whether the toot is marked sensitive + 'sensitive': Denotes whether media attachments to the toot are marked sensitive 'created_at': Creation time 'mentions': A list of account dicts mentioned in the toot 'uri': Descriptor for the toot @@ -123,6 +123,7 @@ Toot dicts 'reblog': Denotes whether the toot is a reblog 'url': URL of the toot 'content': Content of the toot, as HTML: '

Hello from Python

' + 'spoiler_text': Warning text that should be displayed before the toot content 'favourited': Denotes whether the logged in user has favourited this toot 'account': Account dict for the logged in account } diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index b9ab05b..1d0e69f 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -318,7 +318,7 @@ class Mastodon: ### # Writing data: Statuses ### - def status_post(self, status, in_reply_to_id = None, media_ids = None, sensitive = False, visibility = ''): + def status_post(self, status, in_reply_to_id = None, media_ids = None, sensitive = False, visibility = '', spoiler_text = None): """ Post a status. Can optionally be in reply to another status and contain up to four pieces of media (Uploaded via media_post()). media_ids can @@ -338,6 +338,10 @@ class Mastodon: If not passed in, visibility defaults to match the current account's privacy setting (private if the account is locked, public otherwise). + The spoiler_text parameter is a string to be shown as a warning before + the text of the status. If no text is passed in, no warning will be + displayed. + Returns a toot dict with the new status. """ params_initial = locals() -- cgit v1.2.3