Incoming
in package
One message, as it arrived from a connector's network.
The narrow waist of the whole project: a connector turns its own library's
message — a Twitch\Parts\ChatMessage, a Telegram\Parts\Message — into one
of these, and from there nothing downstream knows or cares which network it
came from. ChatRelay routes it, Action
handlers answer it, and neither has a platform's name in it.
Text is already the content of the message: whatever wrapping the platform puts around it has been removed, and whatever this bot adds on the way out is added later. It is not sanitised — the destination decides that, because what IRC cannot carry and what Telegram's HTML mode cannot carry are different sets.
Tags
Table of Contents
Properties
- $author : string
- $authorId : string|null
- $edited : bool
- $handle : string|null
- $id : string|null
- $media : array<string|int, mixed>
- $own : bool
- $quoted : string|null
- $target : string
- $text : string|null
Methods
- __construct() : mixed
- isEmpty() : bool
- Whether there is anything at all worth relaying.
Properties
$author read-only
public
string
$author
$authorId read-only
public
string|null
$authorId
= null
$edited read-only
public
bool
$edited
= false
$handle read-only
public
string|null
$handle
= null
$id read-only
public
string|null
$id
= null
$media read-only
public
array<string|int, mixed>
$media
= []
$own read-only
public
bool
$own
= false
$quoted read-only
public
string|null
$quoted
= null
$target read-only
public
string
$target
$text read-only
public
string|null
$text
= null
Methods
__construct()
public
__construct(string $target, string $author[, string|null $authorId = null ][, string|null $text = null ][, string|null $id = null ][, string|null $quoted = null ][, array<int, Media> $media = [] ][, bool $edited = false ][, bool $own = false ][, string|null $handle = null ]) : mixed
Parameters
- $target : string
-
The room it was said in, as Links keys them.
- $author : string
-
A display name, already resolved.
- $authorId : string|null = null
-
The platform's own id for the author.
- $text : string|null = null
-
nullwhen the message carried no text at all. - $id : string|null = null
-
The platform's message id, when it has one that can be edited.
- $quoted : string|null = null
-
A reply's quoted text, already rendered for display.
- $media : array<int, Media> = []
-
Pictures and files, in the order they were attached.
- $edited : bool = false
-
Whether this is a revision of a message already relayed.
- $own : bool = false
-
Whether the bot itself said it — the loop-prevention check.
- $handle : string|null = null
-
The author's login or username, where the network has one distinct from the display name — what an avatar lookup is keyed by.
isEmpty()
Whether there is anything at all worth relaying.
public
isEmpty() : bool