summaryrefslogtreecommitdiff
path: root/api_ext.py
blob: 15d37e2d5ee6f0774bb421ca5b001f59e0ad955c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from mastodon.versions import _DICT_VERSION_INSTANCE, _DICT_VERSION_ACTIVITY, _DICT_VERSION_ACCOUNT, _DICT_VERSION_EMOJI, _DICT_VERSION_ANNOUNCEMENT
from mastodon.errors import MastodonIllegalArgumentError, MastodonNotFoundError
from mastodon.utility import api_version
from mastodon.compat import urlparse

from mastodon.internals import Mastodon as Internals
from mastodon.types import Instance, InstanceV2, NonPaginatableList, Activity, Nodeinfo, AttribAccessDict, Rule, Announcement, CustomEmoji, Account, IdType

from typing import Union, Optional

class Mastodon(Internals):
	def post_reaction_create(self, statusid: str, reaction: str):
		"""
		Add a reaction to an announcement. `reaction` can either be a unicode emoji
		or the name of one of the instances custom emoji.

		Will throw an API error if the reaction name is not one of the allowed things
		or when trying to add a reaction that the user has already added (adding a
		reaction that a different user added is legal and increments the count).
		"""
		id = self.__unpack_id(id)
		self.__api_request('PUT', f'/api/v1/pleroma/statuses/{id}/reactions/{reaction}')