1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
<?php
namespace App\Events;
use App\Types\EventType;
use App\Types\PresenceState;
class PresenceEvent extends Event
{
public function __construct(
private string $sender,
private string $avatarUrl = "mxc://localhost/wefuiwegh8742w",
private int $lastActiveAgo = 1234,
private bool $currentlyActive = false,
private PresenceState $presence = PresenceState::ONLINE,
private string $statusMessage = "",
)
{
parent::__construct(EventType::PRESENCE);
}
public function fromJson(string $json): static
{
}
public function toJsonEncodeable(): array
{
return [
"type" => $this->type,
"sender" => $this->sender,
"content" => [
"avatar_url" => $this->avatarUrl,
"currently_active" => $this->currentlyActive,
"last_active_ago" => $this->lastActiveAgo,
"presence" => $this->presence,
"status_msg" => $this->statusMessage,
],
];
}
}
|