diff options
Diffstat (limited to 'mastodon/polls.py')
-rw-r--r-- | mastodon/polls.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/mastodon/polls.py b/mastodon/polls.py index d974531..2722ba8 100644 --- a/mastodon/polls.py +++ b/mastodon/polls.py | |||
@@ -17,8 +17,7 @@ class Mastodon(Internals): | |||
17 | Returns a :ref:`poll dict <poll dict>`. | 17 | Returns a :ref:`poll dict <poll dict>`. |
18 | """ | 18 | """ |
19 | id = self.__unpack_id(id) | 19 | id = self.__unpack_id(id) |
20 | url = '/api/v1/polls/{0}'.format(str(id)) | 20 | return self.__api_request('GET', f'/api/v1/polls/{id}') |
21 | return self.__api_request('GET', url) | ||
22 | 21 | ||
23 | ### | 22 | ### |
24 | # Writing data: Polls | 23 | # Writing data: Polls |
@@ -44,9 +43,8 @@ class Mastodon(Internals): | |||
44 | choices = [choices] | 43 | choices = [choices] |
45 | params = self.__generate_params(locals(), ['id']) | 44 | params = self.__generate_params(locals(), ['id']) |
46 | 45 | ||
47 | url = '/api/v1/polls/{0}/votes'.format(id) | 46 | self.__api_request('POST', f'/api/v1/polls/{id}/votes', params) |
48 | self.__api_request('POST', url, params) | 47 | |
49 | |||
50 | def make_poll(self, options, expires_in, multiple=False, hide_totals=False): | 48 | def make_poll(self, options, expires_in, multiple=False, hide_totals=False): |
51 | """ | 49 | """ |
52 | Generate a poll object that can be passed as the `poll` option when posting a status. | 50 | Generate a poll object that can be passed as the `poll` option when posting a status. |