Skip to content

Commit f99a855

Browse files
authored
Add community.hide (#111)
1 parent a82cefb commit f99a855

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

pythorhead/community.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,4 +234,25 @@ def ban_user(
234234
banFromCommunity["remove_data"] = remove_data
235235

236236
return self._requestor.api(Request.POST, "/community/ban_user", json=banFromCommunity)
237+
238+
def hide(
239+
self,
240+
community_id: int,
241+
reason: Optional[str] = None,
242+
hidden: bool = False,
243+
) -> Optional[dict]:
244+
"""
245+
Hide a communtiy from public / "All" view (Admin only)
246+
247+
Args:
248+
community ID(int)
249+
reason (str, optional): Defaults to None
250+
hidden (bool): Defaults to False
251+
252+
Returns:
253+
Optional[dict]:
254+
"""
255+
params: dict[str, Any] = {key: value for key, value in locals().items() if value is not None and key != "self"}
256+
return self._requestor.api(Request.PUT, "/community/hide", json=params)
257+
237258

0 commit comments

Comments
 (0)