From 52fdfee0c121a0b0dae2707f1e7f46e9d31e6649 Mon Sep 17 00:00:00 2001 From: spla Date: Fri, 7 Oct 2022 13:02:53 +0200 Subject: [PATCH] Added more endpoints --- misskey/misskeyapi.py | 99 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 98 insertions(+), 1 deletion(-) diff --git a/misskey/misskeyapi.py b/misskey/misskeyapi.py index 95c4331..255a5ef 100644 --- a/misskey/misskeyapi.py +++ b/misskey/misskeyapi.py @@ -68,6 +68,62 @@ class MisskeyAPI: self.__request_timeout = request_timeout + ### + # admin + ### + + def admin_silence_user(self, i=None, userId=None): + + params = { + 'i': i, + 'userId': userId + } + + endpoint = self.api_base_url + '/api/admin/silence-user' + + response = self.__api_request(endpoint, params) + + return response + + def admin_suspend_user(self, i=None, userId=None): + + params = { + 'i': i, + 'userId': userId + } + + endpoint = self.api_base_url + '/api/admin/suspend-user' + + response = self.__api_request(endpoint, params) + + return response + + def admin_unsilence_user(self, i=None, userId=None): + + params = { + 'i': i, + 'userId': userId + } + + endpoint = self.api_base_url + '/api/admin/unsilence-user' + + response = self.__api_request(endpoint, params) + + return response + + def admin_unsuspend_user(self, i=None, userId=None): + + params = { + 'i': i, + 'userId': userId + } + + endpoint = self.api_base_url + '/api/admin/unsuspend-user' + + response = self.__api_request(endpoint, params) + + return response + def i(self, i=None): params = { @@ -247,12 +303,53 @@ class MisskeyAPI: return response + def blocking_create(self, i=None, userId=None): + + params = { + 'i': i, + 'userId': userId, + } + + endpoint = self.api_base_url + '/api/blocking/create' + + response = self.__api_request(endpoint, params) + + return response + + def blocking_delete(self, i=None, userId=None): + + params = { + 'i': i, + 'userId': userId, + } + + endpoint = self.api_base_url + '/api/blocking/delete' + + response = self.__api_request(endpoint, params) + + return response + + def blocking_list(self, i=None, limit=None, sinceId=None, untilId=None): + + params = { + 'i': i, + 'limit': limit, + 'sinceId': sinceId, + 'untilId': untilId + } + + endpoint = self.api_base_url + '/api/blocking/list' + + response = self.__api_request(endpoint, params) + + return response + def federation_instances(self): params = { } - endpoint = self.api_base_url + '/api/federation/instances' + endpoint = self.api_base_url + '/api/blocking/instances' response = self.__api_request(endpoint, params)