Module slack_bolt.context.say_stream.say_stream

Classes

class SayStream (*,
client: slack_sdk.web.client.WebClient,
channel: str | None = None,
recipient_team_id: str | None = None,
recipient_user_id: str | None = None,
thread_ts: str | None = None)
Expand source code
class SayStream:
    client: WebClient
    channel: Optional[str]
    recipient_team_id: Optional[str]
    recipient_user_id: Optional[str]
    thread_ts: Optional[str]

    def __init__(
        self,
        *,
        client: WebClient,
        channel: Optional[str] = None,
        recipient_team_id: Optional[str] = None,
        recipient_user_id: Optional[str] = None,
        thread_ts: Optional[str] = None,
    ):
        self.client = client
        self.channel = channel
        self.recipient_team_id = recipient_team_id
        self.recipient_user_id = recipient_user_id
        self.thread_ts = thread_ts

    def __call__(
        self,
        *,
        buffer_size: Optional[int] = None,
        channel: Optional[str] = None,
        recipient_team_id: Optional[str] = None,
        recipient_user_id: Optional[str] = None,
        thread_ts: Optional[str] = None,
        **kwargs,
    ) -> ChatStream:
        """Starts a new chat stream with context."""
        channel = channel or self.channel
        thread_ts = thread_ts or self.thread_ts
        if channel is None:
            raise ValueError("say_stream without channel here is unsupported")
        if thread_ts is None:
            raise ValueError("say_stream without thread_ts here is unsupported")

        if buffer_size is not None:
            return self.client.chat_stream(
                buffer_size=buffer_size,
                channel=channel,
                recipient_team_id=recipient_team_id or self.recipient_team_id,
                recipient_user_id=recipient_user_id or self.recipient_user_id,
                thread_ts=thread_ts,
                **kwargs,
            )
        return self.client.chat_stream(
            channel=channel,
            recipient_team_id=recipient_team_id or self.recipient_team_id,
            recipient_user_id=recipient_user_id or self.recipient_user_id,
            thread_ts=thread_ts,
            **kwargs,
        )

Class variables

var channel : str | None

The type of the None singleton.

var client : slack_sdk.web.client.WebClient

The type of the None singleton.

var recipient_team_id : str | None

The type of the None singleton.

var recipient_user_id : str | None

The type of the None singleton.

var thread_ts : str | None

The type of the None singleton.