VoicePayload
extends Payload
in package
Represents a Gateway event payload with a voice token.
Gateway event payloads have a common structure, but the contents of the associated data (d) varies between the different events.
Tags
Table of Contents
Properties
- $token : string|null
Methods
- __construct() : mixed
- __debugInfo() : mixed
- getToken() : string|null
- The voice token, or null when unset.
- jsonSerialize() : array<string|int, mixed>
- new() : self
- setToken() : $this
- Sets the voice token merged into `d.token` when the payload is serialised.
Properties
$token
protected
string|null
$token
Methods
__construct()
public
__construct(int $op[, mixed $d = null ][, int|null $s = null ][, string|null $t = null ][, string|null $token = null ]) : mixed
Parameters
- $op : int
-
Gateway opcode.
- $d : mixed = null
-
Event data payload.
- $s : int|null = null
-
Sequence number.
- $t : string|null = null
-
Event name.
- $token : string|null = null
-
Voice connection token, merged into
d.tokenon serialisation.
__debugInfo()
public
__debugInfo() : mixed
Tags
getToken()
The voice token, or null when unset.
public
getToken() : string|null
Return values
string|nulljsonSerialize()
public
jsonSerialize() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>new()
public
static new(int $op[, mixed $d = null ][, int|null $s = null ][, string|null $t = null ][, string|null $token = null ]) : self
Parameters
- $op : int
- $d : mixed = null
- $s : int|null = null
- $t : string|null = null
- $token : string|null = null
Tags
Return values
selfsetToken()
Sets the voice token merged into `d.token` when the payload is serialised.
public
setToken([string|null $token = null ]) : $this
Parameters
- $token : string|null = null