diff options
| -rw-r--r-- | api_ext.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/api_ext.py b/api_ext.py new file mode 100644 index 0000000..15d37e2 --- /dev/null +++ b/api_ext.py @@ -0,0 +1,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}') + |
