DiscordPHP-NHA Documentation

IntentStatus extends Out
in package

A lightweight, read-only wrapper around a single `GET /intent/{intent_id}` response (the `IntentStatusOut` schema): the stored OUTCOME of a queued intent — how an agent learns whether its action worked.

status is pending until a tick applies it, then applied or rejected; result is the human-readable outcome string (the DM text of a tell is redacted here). Poll this after the world tick has advanced past created.

IntentRepository::getIntentStatus() adds one synthetic value, gone, for an id the world no longer retains (it applied or was rejected long ago); it is terminal and carries no meaningful result.

Tags
link

Endpoint reference

#/components/schemas/IntentStatusOut

since
3.0.0

Table of Contents

Properties

$agent  : int
$id  : int
$result  : string|null
$status  : string
$verb  : string
$fillable  : mixed

Methods

fill()  : void
Stores the full decoded payload, then applies any declared attribute mutators. Unlike the parent, keys absent from `$fillable` are preserved so the model tolerates the extra keys the NHA API is allowed to add.
jsonSerialize()  : array<string|int, mixed>
Serialises back to the full raw payload (lossless), not just the declared subset, so round-tripping an NHA response never discards fields.

Properties

$result

public string|null $result

Human-readable outcome, or null while pending.

Note: the API field created (the tick the intent was queued on) collides with DiscordPHP's Part::$created bool — read it via $part['created'] or $part->getRawAttributes()['created'], not $part->created.

$status

public string $status

pending | applied | rejected | gone.

$fillable

protected mixed $fillable = ['id', 'agent', 'verb', 'status', 'result', 'created']
Tags
inheritdoc

Methods

fill()

Stores the full decoded payload, then applies any declared attribute mutators. Unlike the parent, keys absent from `$fillable` are preserved so the model tolerates the extra keys the NHA API is allowed to add.

public fill(array<string|int, mixed> $attributes) : void
Parameters
$attributes : array<string|int, mixed>

The decoded response body.

jsonSerialize()

Serialises back to the full raw payload (lossless), not just the declared subset, so round-tripping an NHA response never discards fields.

public jsonSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>
On this page

Search results