aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2019-04-28 23:12:27 +0200
committerLorenz Diener <[email protected]>2019-04-28 23:12:27 +0200
commit09c03296db1671e80f5e7814045e826f1975fb0b (patch)
tree87e709b3b2b5aa86909bee4db89a04c0340d3d0d /docs
parent3eba3f8835f25800f37b9da18a09429b084effa0 (diff)
downloadmastodon.py-09c03296db1671e80f5e7814045e826f1975fb0b.tar.gz
Polls
Diffstat (limited to 'docs')
-rw-r--r--docs/index.rst41
1 files changed, 39 insertions, 2 deletions
diff --git a/docs/index.rst b/docs/index.rst
index a98eb23..6e798d7 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -314,6 +314,7 @@ Toot dicts
314 'replies_count': # The number of replies to this status. 314 'replies_count': # The number of replies to this status.
315 'card': # A preview card for links from the status, if present at time of delivery, 315 'card': # A preview card for links from the status, if present at time of delivery,
316 # as card dict. 316 # as card dict.
317 'poll': # A poll dict if a poll is attached to this status.
317 } 318 }
318 319
319Mention dicts 320Mention dicts
@@ -355,7 +356,29 @@ Scheduled toot dicts
355 }, 356 },
356 'media_attachments': # Array of media dicts for the attachments to the scheduled toot 357 'media_attachments': # Array of media dicts for the attachments to the scheduled toot
357 } 358 }
358 359
360Poll dicts
361~~~~~~~~~~
362.. _poll dict:
363
364.. code-block:: python
365
366 # Returns the following dictionary:
367 mastodon.poll(id)
368 {
369 'id': # The polls ID
370 'expires_at': # The time at which the poll is set to expire
371 'expired': # Boolean denoting whether you can still vote in this poll
372 'multiple': # Boolean indicating whether it is allowed to vote for more than one option
373 'votes_count': # Total number of votes cast in this poll
374 'voted': # Boolean indicating whether the logged-in user has already voted in this poll
375 'options': # The poll options as a list of dicts, each option with a `title` and a
376 # `votes_count` field. `votes_count` can be None if the poll creator has
377 # chosen to hide vote totals until the poll expires and it hasn't yet.
378 'emojis': # List of emoji dicts for all emoji used in answer strings
379 }
380
381
359Conversation dicts 382Conversation dicts
360~~~~~~~~~~~~~~~~~~ 383~~~~~~~~~~~~~~~~~~
361.. _conversation dict: 384.. _conversation dict:
@@ -797,13 +820,19 @@ These functions allow you to get information about single statuses.
797.. automethod:: Mastodon.status_favourited_by 820.. automethod:: Mastodon.status_favourited_by
798.. automethod:: Mastodon.status_card 821.. automethod:: Mastodon.status_card
799 822
800Writing data: Scheduled statuses 823Reading data: Scheduled statuses
801~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 824~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
802These functions allow you to get information about scheduled statuses. 825These functions allow you to get information about scheduled statuses.
803 826
804.. automethod:: Mastodon.scheduled_statuses 827.. automethod:: Mastodon.scheduled_statuses
805.. automethod:: Mastodon.scheduled_status 828.. automethod:: Mastodon.scheduled_status
806 829
830Reading data: Polls
831~~~~~~~~~~~~~~~~~~~
832This function allows you to get and refresh information about polls.
833
834.. automethod:: Mastodon.poll
835
807Reading data: Notifications 836Reading data: Notifications
808--------------------------- 837---------------------------
809This function allows you to get information about a users notifications. 838This function allows you to get information about a users notifications.
@@ -913,6 +942,8 @@ interact with already posted statuses.
913.. automethod:: Mastodon.status_post 942.. automethod:: Mastodon.status_post
914.. automethod:: Mastodon.status_reply 943.. automethod:: Mastodon.status_reply
915.. automethod:: Mastodon.toot 944.. automethod:: Mastodon.toot
945.. _make_poll():
946.. automethod:: Mastodon.make_poll
916.. automethod:: Mastodon.status_reblog 947.. automethod:: Mastodon.status_reblog
917.. automethod:: Mastodon.status_unreblog 948.. automethod:: Mastodon.status_unreblog
918.. automethod:: Mastodon.status_favourite 949.. automethod:: Mastodon.status_favourite
@@ -932,6 +963,12 @@ scheduled statuses.
932.. automethod:: Mastodon.scheduled_status_update 963.. automethod:: Mastodon.scheduled_status_update
933.. automethod:: Mastodon.scheduled_status_delete 964.. automethod:: Mastodon.scheduled_status_delete
934 965
966Writing data: Polls
967~~~~~~~~~~~~~~~~~~~
968This function allows you to vote in polls.
969
970.. automethod:: Mastodon.poll_vote
971
935Writing data: Notifications 972Writing data: Notifications
936--------------------------- 973---------------------------
937These functions allow you to clear all or some notifications. 974These functions allow you to clear all or some notifications.
Powered by cgit v1.2.3 (git 2.41.0)