aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErin Congden <[email protected]>2017-04-02 18:46:43 -0700
committerErin Congden <[email protected]>2017-04-02 21:14:07 -0700
commitf734a45fb667baf40d2cae3696934f91f1d5d8d0 (patch)
tree3e09a52f50c0cc5df28504f0069ca7262dbb9c7f
parent857968f34e19191e0ae5771b3a62e450a180ad0e (diff)
downloadmastodon.py-f734a45fb667baf40d2cae3696934f91f1d5d8d0.tar.gz
Added spoiler text support
-rw-r--r--docs/index.rst3
-rw-r--r--mastodon/Mastodon.py6
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
108 mastodon.toot("Hello from Python") 108 mastodon.toot("Hello from Python")
109 # Returns the following dictionary: 109 # Returns the following dictionary:
110 { 110 {
111 'sensitive': Denotes whether the toot is marked sensitive 111 'sensitive': Denotes whether media attachments to the toot are marked sensitive
112 'created_at': Creation time 112 'created_at': Creation time
113 'mentions': A list of account dicts mentioned in the toot 113 'mentions': A list of account dicts mentioned in the toot
114 'uri': Descriptor for the toot 114 'uri': Descriptor for the toot
@@ -123,6 +123,7 @@ Toot dicts
123 'reblog': Denotes whether the toot is a reblog 123 'reblog': Denotes whether the toot is a reblog
124 'url': URL of the toot 124 'url': URL of the toot
125 'content': Content of the toot, as HTML: '<p>Hello from Python</p>' 125 'content': Content of the toot, as HTML: '<p>Hello from Python</p>'
126 'spoiler_text': Warning text that should be displayed before the toot content
126 'favourited': Denotes whether the logged in user has favourited this toot 127 'favourited': Denotes whether the logged in user has favourited this toot
127 'account': Account dict for the logged in account 128 'account': Account dict for the logged in account
128 } 129 }
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:
318 ### 318 ###
319 # Writing data: Statuses 319 # Writing data: Statuses
320 ### 320 ###
321 def status_post(self, status, in_reply_to_id = None, media_ids = None, sensitive = False, visibility = ''): 321 def status_post(self, status, in_reply_to_id = None, media_ids = None, sensitive = False, visibility = '', spoiler_text = None):
322 """ 322 """
323 Post a status. Can optionally be in reply to another status and contain 323 Post a status. Can optionally be in reply to another status and contain
324 up to four pieces of media (Uploaded via media_post()). media_ids can 324 up to four pieces of media (Uploaded via media_post()). media_ids can
@@ -338,6 +338,10 @@ class Mastodon:
338 If not passed in, visibility defaults to match the current account's 338 If not passed in, visibility defaults to match the current account's
339 privacy setting (private if the account is locked, public otherwise). 339 privacy setting (private if the account is locked, public otherwise).
340 340
341 The spoiler_text parameter is a string to be shown as a warning before
342 the text of the status. If no text is passed in, no warning will be
343 displayed.
344
341 Returns a toot dict with the new status. 345 Returns a toot dict with the new status.
342 """ 346 """
343 params_initial = locals() 347 params_initial = locals()
Powered by cgit v1.2.3 (git 2.41.0)