twitch_channel
twitch_channel
¶
TwitchChannel — Twitch chat adapter via twitchio.
Classes¶
TwitchChannel
¶
TwitchChannel(
access_token: str = "",
*,
client_id: str = "",
nick: str = "",
initial_channels: str = "",
bus: Optional[EventBus] = None,
)
Bases: BaseChannel
Twitch chat messaging channel adapter.
Uses the Twitch IRC/EventSub API via twitchio.
| PARAMETER | DESCRIPTION |
|---|---|
access_token
|
Twitch OAuth access token. Falls back to
TYPE:
|
client_id
|
Twitch application client ID. Falls back to
TYPE:
|
nick
|
Bot nickname for IRC. Falls back to
TYPE:
|
initial_channels
|
Comma-separated list of channels to join. Falls back to
TYPE:
|
bus
|
Optional event bus for publishing channel events.
TYPE:
|
Source code in src/diapason/channels/twitch_channel.py
Methods:¶
connect
¶
Validate credentials and mark as connected.
Source code in src/diapason/channels/twitch_channel.py
disconnect
¶
send
¶
send(
channel: str,
content: str,
*,
conversation_id: str = "",
metadata: Dict[str, Any] | None = None,
) -> bool
Send a chat message to a Twitch channel.
| PARAMETER | DESCRIPTION |
|---|---|
channel
|
Twitch channel name (without
TYPE:
|
content
|
Chat message content.
TYPE:
|
Note
For send-only usage this uses the Twitch Helix API to send a chat message. A full interactive bot would use the twitchio event loop.
Source code in src/diapason/channels/twitch_channel.py
status
¶
status() -> ChannelStatus