diff --git a/itd/client.py b/itd/client.py index e49c758..1ba28b4 100644 --- a/itd/client.py +++ b/itd/client.py @@ -3,6 +3,8 @@ from itd.comments import get_comments, add_comment, delete_comment, like_comment from itd.hashtags import get_hastags, get_posts_by_hastag from itd.notifications import get_notifications, mark_as_read, mark_all_as_read, get_unread_notifications_count from itd.posts import create_post, get_posts, get_post, edit_post, delete_post, pin_post, repost, view_post +from itd.reports import report + class Client: def __init__(self, token: str): @@ -73,4 +75,17 @@ class Client: return repost(self.token, id, content) def view_post(self, id: str): - return view_post(self.token, id) \ No newline at end of file + return view_post(self.token, id) + + + def report(self, id: str, type: str = 'post', reason: str = 'other', description: str = ''): + return report(id, type, reason, description) + + def report_user(self, id: str, reason: str = 'other', description: str = ''): + return report(id, 'user', reason, description) + + def report_post(self, id: str, reason: str = 'other', description: str = ''): + return report(id, 'post', reason, description) + + def report_comment(self, id: str, reason: str = 'other', description: str = ''): + return report(id, 'comment', reason, description) \ No newline at end of file diff --git a/itd/reports.py b/itd/reports.py new file mode 100644 index 0000000..933f48d --- /dev/null +++ b/itd/reports.py @@ -0,0 +1,4 @@ +from itd.request import fetch + +def report(token: str, id: str, type: str = 'post', reason: str = 'other', description: str = ''): + return fetch(token, 'post', 'reports', {'targetId': id, 'targetType': type, 'reason': reason, 'description': description}) \ No newline at end of file