StreamActions
in package
implements
ProvidesActions
uses
UsesTwitch
The live-stream side of the API: whether it is up, for how long, to how many, and the things worth capturing while it is.
Tags
Table of Contents
Interfaces
- ProvidesActions
- A connector that brings commands of its own.
Methods
- actions() : array<int, Action>
- Every command this connector defines.
- clip() : PromiseInterface<string|int, string>
- 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.
- followers() : PromiseInterface<string|int, string>
- live() : PromiseInterface<string|int, object|null>
- The current stream, or `null` when the channel is offline.
- marker() : PromiseInterface<string|int, string>
- search() : PromiseInterface<string|int, string>
- stream() : PromiseInterface<string|int, string>
- twitch() : TwitchConnector
- uptime() : PromiseInterface<string|int, string>
- viewers() : PromiseInterface<string|int, string>
Methods
actions()
Every command this connector defines.
public
actions() : array<int, Action>
Each one's qualifier must be the connector's own Connector::name(); ActionRegistry refuses anything else, because a connector claiming another's qualifier is how two packages end up silently shadowing each other's commands.
Return values
array<int, Action>clip()
private
clip(Context $context, Arguments $arguments) : PromiseInterface<string|int, string>
Parameters
Return values
PromiseInterface<string|int, string>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
Throwablefollowers()
private
followers(Context $context, Arguments $arguments) : PromiseInterface<string|int, string>
Parameters
Return values
PromiseInterface<string|int, string>live()
The current stream, or `null` when the channel is offline.
private
live(Context $context) : PromiseInterface<string|int, object|null>
Helix signals "offline" by returning an empty list rather than an error, which is why this returns null instead of rejecting.
Parameters
- $context : Context
Return values
PromiseInterface<string|int, object|null>marker()
private
marker(Context $context, Arguments $arguments) : PromiseInterface<string|int, string>
Parameters
Return values
PromiseInterface<string|int, string>search()
private
search(Context $context, Arguments $arguments) : PromiseInterface<string|int, string>
Parameters
Return values
PromiseInterface<string|int, string>stream()
private
stream(Context $context, Arguments $arguments) : PromiseInterface<string|int, string>
Parameters
Return values
PromiseInterface<string|int, string>twitch()
private
twitch(Context $context) : TwitchConnector
Parameters
- $context : Context
Return values
TwitchConnectoruptime()
private
uptime(Context $context, Arguments $arguments) : PromiseInterface<string|int, string>
Parameters
Return values
PromiseInterface<string|int, string>viewers()
private
viewers(Context $context, Arguments $arguments) : PromiseInterface<string|int, string>