UsesTwitch
Reaches the Twitch client from inside an action.
An action is handed a Context, which knows the bot but deliberately not the network — that is what lets the same catalogue serve every chat. A Twitch action does need the Twitch client, so it asks the bot for the connector by name.
It can genuinely be absent: the connector is installed only when the
environment carries Twitch credentials, and it can fail to start while the
rest of the bot runs on. Saying so is better than a TypeError two frames
down, and it is the same answer somebody typing !twitch title into a
Telegram group deserves when there is no Twitch side configured at all.
Tags
Table of Contents
Methods
- explained() : callable(Context, Arguments): mixed
- Wraps a handler so a Helix refusal reaches whoever typed the command as a sentence, rather than as "that did not work".
- explainTwitch() : Throwable
- What Twitch's refusal means to the person who asked.
- twitch() : TwitchConnector
Methods
explained()
Wraps a handler so a Helix refusal reaches whoever typed the command as a sentence, rather than as "that did not work".
private
explained(callable(Context, Arguments): mixed $handler) : callable(Context, Arguments): mixed
Parameters
Return values
callable(Context, Arguments): mixedexplainTwitch()
What Twitch's refusal means to the person who asked.
private
static explainTwitch(Throwable $e) : Throwable
A 4xx from Helix carries a message written for people — "The user specified in the user_id field is already banned." — and nothing secret, so it is passed on. Anything else (a 5xx, a dropped connection) is left for the adapter to log and summarise.
Parameters
- $e : Throwable
Return values
Throwabletwitch()
private
twitch(Context $context) : TwitchConnector
Parameters
- $context : Context