DiscordPHP-BridgeBot Documentation

StreamActions
in package
implements ProvidesActions uses UsesTwitch

FinalYes

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
author

Valithor Obsidion valithor@valgorithms.com

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>

explainTwitch()

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
Throwable

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>
On this page

Search results