Added more endpoints

This commit is contained in:
spla 2022-10-07 13:02:53 +02:00
pare 856abe1a24
commit 52fdfee0c1

Veure arxiu

@ -68,6 +68,62 @@ class MisskeyAPI:
self.__request_timeout = request_timeout 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): def i(self, i=None):
params = { params = {
@ -247,12 +303,53 @@ class MisskeyAPI:
return response 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): def federation_instances(self):
params = { params = {
} }
endpoint = self.api_base_url + '/api/federation/instances' endpoint = self.api_base_url + '/api/blocking/instances'
response = self.__api_request(endpoint, params) response = self.__api_request(endpoint, params)