diff --git a/README.md b/README.md index a6ff2998..857a2ff2 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ![GitHub stars](https://img.shields.io/github/stars/switchcollab/Switch-Bots-Python-Library) ![GitHub Forks](https://img.shields.io/github/forks/switchcollab/Switch-Bots-Python-Library) -![Version](https://img.shields.io/badge/version-1.4.55-green.svg) +![Version](https://img.shields.io/badge/version-1.4.62-green.svg) ![PyPI - Downloads](https://img.shields.io/pypi/dm/swibots) # SwiBots: Python Library for Switch App diff --git a/setup.py b/setup.py index 8c92f372..23a4611a 100644 --- a/setup.py +++ b/setup.py @@ -16,8 +16,8 @@ setup( name="swibots", - version="1.4.60", - packages=find_packages(include=['swibots']), + version="1.4.62", + packages=find_packages(include=['swibots*']), long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/switchcollab/Switch-Bots-Python-Library", diff --git a/swibots/api/chat/controllers/heading_controller.py b/swibots/api/chat/controllers/heading_controller.py index 906e0836..d667f53d 100644 --- a/swibots/api/chat/controllers/heading_controller.py +++ b/swibots/api/chat/controllers/heading_controller.py @@ -60,6 +60,7 @@ async def delete_heading(self, community_id: str, heading_name: str): response = await self.client.post(f"/headings/delete-headings?{query}") return response.data + async def edit_heading( self, community_id: str, @@ -77,3 +78,17 @@ async def edit_heading( ) response = await self.client.post(f"/headings/edit-headings?{query}") return response.data + + async def rearrange_headings(self, + community_id: str, + heading_names: List[str], + subheading: str = '' + ): + body = { + "communityId": community_id, + "headingNames": heading_names, + "subHeading": subheading + } + response = await self.client.post("/headings/rearrange-headings", + data=body) + \ No newline at end of file diff --git a/swibots/api/chat/controllers/media_controller.py b/swibots/api/chat/controllers/media_controller.py index d5de5fca..71d4e701 100644 --- a/swibots/api/chat/controllers/media_controller.py +++ b/swibots/api/chat/controllers/media_controller.py @@ -195,7 +195,7 @@ def __init__(self, client: "ChatClient") -> None: self.client = client self.api_url = "https://storage.switch.click" - self._min_file_size = 150 * 1024 * 1024 + self._min_file_size = 200 * 1024 * 1024 async def get_upload_url(self): async with AsyncClient(timeout=None) as client: @@ -291,7 +291,7 @@ async def upload_media( callback: UploadProgressCallback = None, callback_args: Optional[tuple] = None, auto_thumb: Optional[bool] = True, - part_size: int = int(os.getenv("UPLOAD_PART_SIZE", 100 * 1024 * 1024)), + part_size: int = int(os.getenv("UPLOAD_PART_SIZE", 200 * 1024 * 1024)), task_count: int = int(os.getenv("UPLOAD_TASKS", 0)), for_document: bool = False, premium: bool = False, diff --git a/swibots/api/chat/controllers/message_controller.py b/swibots/api/chat/controllers/message_controller.py index a82b3e42..f69617ea 100644 --- a/swibots/api/chat/controllers/message_controller.py +++ b/swibots/api/chat/controllers/message_controller.py @@ -183,7 +183,7 @@ async def send_media( async def _upload_media(media): if document: force_storage_method = kwargs.get("secondary_upload", False) - private_community = None + private_community = bool(user_id) if community_id: community = await self.client.app.get_community(community_id) private_community = not community.is_public @@ -782,8 +782,8 @@ async def search_community_data( query: str, community_id: str, filter: Literal[ - "MESSAGES", "MEDIA", "LINK", "GROUP", "CHANNEL", "MEMBER" - ] = "MESSAGES", + "MESSAGE", "MEDIA", "LINK", "GROUP", "CHANNEL", "MEMBER" + ] = "MESSAGE", limit: int = 10, page: int = 0, ) -> Union[List[Message], List[Group], List[Channel], List[SearchResultUser]]: @@ -810,7 +810,7 @@ async def search_community_data( response = await self.client.get( "/v1/search/community-data?{}".format(urlencode(data)) ) - if filter in ["MESSAGES", "MEDIA", "LINK"]: + if filter in ["MESSAGE", "MEDIA", "LINK"]: return self.client.build_list(Message, response.data) elif filter == "GROUP": return self.client.build_list(Group, response.data) diff --git a/swibots/api/chat/methods/get_community_media_files.py b/swibots/api/chat/methods/get_community_media_files.py index 320ccd66..b8c51bdf 100644 --- a/swibots/api/chat/methods/get_community_media_files.py +++ b/swibots/api/chat/methods/get_community_media_files.py @@ -29,8 +29,8 @@ async def search_community_data( query: str, community_id: str, filter: Literal[ - "MESSAGES", "MEDIA", "LINK", "GROUP", "CHANNEL", "MEMBER" - ] = "MESSAGES", + "MESSAGE", "MEDIA", "LINK", "GROUP", "CHANNEL", "MEMBER" + ] = "MESSAGE", limit: int = 10, page: int = 0, ) -> Union[List[Message], List[Group], List[Channel], List[SearchResultUser]]: