Skip to content

twitch_channel

diapason.channels.twitch_channel

TwitchChannel — Twitch chat adapter via twitchio.

TwitchChannel

Bases: BaseChannel

Twitch chat messaging channel adapter.

Uses the Twitch IRC/EventSub API via twitchio.

Parameters

access_token: Twitch OAuth access token. Falls back to TWITCH_ACCESS_TOKEN env var. client_id: Twitch application client ID. Falls back to TWITCH_CLIENT_ID env var. nick: Bot nickname for IRC. Falls back to TWITCH_NICK env var. initial_channels: Comma-separated list of channels to join. Falls back to TWITCH_CHANNELS env var. bus: Optional event bus for publishing channel events.

connect()

Validate credentials and mark as connected.

disconnect()

Mark as disconnected.

list_channels()

Return available channel identifiers.

on_message(handler)

Register a callback for incoming messages.

send(channel, content, *, conversation_id='', metadata=None)

Send a chat message to a Twitch channel.

Parameters

channel: Twitch channel name (without # prefix). content: Chat message content.

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.

status()

Return the current connection status.