From e1100ae5245b65372d5eeee0edf90ac1e2c0175d Mon Sep 17 00:00:00 2001 From: Lennart Kuijs Date: Sat, 17 Jan 2026 14:00:09 +0100 Subject: [PATCH] feat: [CHA-1699] add Future Channel Bans support - ban_from_future_channels and remove_future_channels_ban are automatically supported via **options kwargs in ban_user and unban_user methods - Add query_future_channel_bans method to query FCBs Co-Authored-By: Claude Opus 4.5 --- stream_chat/async_chat/client.py | 16 ++++++++++++++++ stream_chat/base/client.py | 17 +++++++++++++++++ stream_chat/client.py | 16 ++++++++++++++++ 3 files changed, 49 insertions(+) diff --git a/stream_chat/async_chat/client.py b/stream_chat/async_chat/client.py index ebecf7c..edc9e2d 100644 --- a/stream_chat/async_chat/client.py +++ b/stream_chat/async_chat/client.py @@ -232,6 +232,22 @@ async def query_banned_users(self, query_conditions: Dict) -> StreamResponse: "query_banned_users", params={"payload": json.dumps(query_conditions)} ) + async def query_future_channel_bans(self, **options: Any) -> StreamResponse: + """ + Query future channel bans created by a user. + + :param options: Optional parameters including: + - user_id: The ID of the user who created the bans + - exclude_expired_bans: Whether to exclude expired bans + - limit: Maximum number of results to return + - offset: Number of results to skip + + :return: A StreamResponse containing the list of future channel bans + """ + return await self.get( + "query_future_channel_bans", params={"payload": json.dumps(options)} + ) + async def block_user( self, blocked_user_id: str, user_id: str, **options: Any ) -> StreamResponse: diff --git a/stream_chat/base/client.py b/stream_chat/base/client.py index b9c9827..750fcc8 100644 --- a/stream_chat/base/client.py +++ b/stream_chat/base/client.py @@ -356,6 +356,23 @@ def query_banned_users( """ pass + @abc.abstractmethod + def query_future_channel_bans( + self, **options: Any + ) -> Union[StreamResponse, Awaitable[StreamResponse]]: + """ + Query future channel bans created by a user. + + :param options: Optional parameters including: + - user_id: The ID of the user who created the bans + - exclude_expired_bans: Whether to exclude expired bans + - limit: Maximum number of results to return + - offset: Number of results to skip + + :return: A StreamResponse containing the list of future channel bans + """ + pass + @abc.abstractmethod def block_user( self, blocked_user_id: str, user_id: str, **options: Any diff --git a/stream_chat/client.py b/stream_chat/client.py index c2a0de8..b9fafd8 100644 --- a/stream_chat/client.py +++ b/stream_chat/client.py @@ -232,6 +232,22 @@ def query_banned_users(self, query_conditions: Dict) -> StreamResponse: "query_banned_users", params={"payload": json.dumps(query_conditions)} ) + def query_future_channel_bans(self, **options: Any) -> StreamResponse: + """ + Query future channel bans created by a user. + + :param options: Optional parameters including: + - user_id: The ID of the user who created the bans + - exclude_expired_bans: Whether to exclude expired bans + - limit: Maximum number of results to return + - offset: Number of results to skip + + :return: A StreamResponse containing the list of future channel bans + """ + return self.get( + "query_future_channel_bans", params={"payload": json.dumps(options)} + ) + def block_user( self, blocked_user_id: str, user_id: str, **options: Any ) -> StreamResponse: