Skip to content

Commit 5972f54

Browse files
authored
Add hide post function (#108)
1 parent a741d45 commit 5972f54

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

pythorhead/post.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,24 @@ def lock(self, post_id: int, locked: bool) -> Optional[dict]:
299299
}
300300
return self._requestor.api(Request.POST, "/post/lock", json=lock_post)
301301

302+
def hide(self, post_id: int, hide: bool) -> Optional[dict]:
303+
"""
304+
305+
Hide a post
306+
307+
Args:
308+
post_id (int)
309+
hide (bool)
310+
311+
Returns:
312+
Optional[dict]: post data if successful
313+
"""
314+
hide_post = {
315+
"post_ids": [post_id],
316+
"hide": hide,
317+
}
318+
return self._requestor.api(Request.POST, "/post/hide", json=hide_post)
319+
302320
def mark_as_read(self, post_id: int, read: bool) -> Optional[dict]:
303321
"""
304322

0 commit comments

Comments
 (0)