FossabotMessage
final class FossabotMessage extends FossabotDataModel implements FossabotMessage (View source)
Fossabot message context data model. This is only present when the custom API request was invoked from a chat message or command. When dispatched from an automated action, such as a timer, this will be null.
Traits
Trait to consolidate the methods needs to implement the \Brandon14\FossabotCommander\Contracts\Stringable interface.
Trait to consolidate functionality of converting a class to JSON representation.
Properties
protected | $data | Data model. |
from FossabotDataModel |
Methods
Magic method https://www.php.net/manual/en/language.oop5.magic.php#object. toString allows a class to decide how it will react when it is treated like a string.
Creates a new Fossabot data model instance from a parsed array of API data.
Message ID.
Message contents.
Message provider (i.e. twitch, etc.).
User who invoked the message.
Details
string
toJson($options = 0)
{@inheritDoc}
__toString()
Magic method https://www.php.net/manual/en/language.oop5.magic.php#object. toString allows a class to decide how it will react when it is treated like a string.
string
toString()
{@inheritDoc}
bool
offsetExists(string $offset)
Whether an offset exists.
offsetGet(string $offset)
Offset to retrieve.
void
offsetSet(string $offset, mixed $value)
Offset to set.
void
offsetUnset(string $offset)
Offset to unset.
array
__serialize()
Serializes data.
void
__unserialize(array $data)
Unserializes data.
__get(string $name)
Gets property.
void
__set(string $name, mixed $value)
Sets property.
bool
__isset(string $name)
Checks for existence of property.
void
__unset(string $name)
Unsets property.
array
jsonSerialize()
Specify data which should be serialized to JSON.
toArray()
No description
static FossabotDataModel
createFromBody(array $body)
Creates a new Fossabot data model instance from a parsed array of API data.
string
id()
Message ID.
string
content()
Message contents.
string
provider()
Message provider (i.e. twitch, etc.).
FossabotUser
user()
User who invoked the message.