diff --git a/toot/api.py b/toot/api.py index baa4c28..89c801b 100644 --- a/toot/api.py +++ b/toot/api.py @@ -361,6 +361,12 @@ def whois(app, user, account): return http.get(app, user, f'/api/v1/accounts/{account}').json() +def vote(app, user, poll_id, choices: list): + url = f"/api/v1/polls/{poll_id}/votes" + json = {'choices': choices} + return http.post(app, user, url, json=json).json() + + def mute(app, user, account): return _account_action(app, user, account, 'mute')