1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace FondBot\Events; |
||
6 | |||
7 | use FondBot\Channels\Chat; |
||
8 | use FondBot\Channels\User; |
||
9 | use FondBot\Templates\Location; |
||
10 | use FondBot\Templates\Attachment; |
||
11 | |||
12 | class MessageReceived extends Event |
||
13 | { |
||
14 | private $chat; |
||
15 | private $from; |
||
16 | private $text; |
||
17 | private $location; |
||
18 | private $attachment; |
||
19 | private $data; |
||
20 | private $raw; |
||
21 | |||
22 | public function __construct( |
||
23 | Chat $chat, |
||
24 | 27 | User $from, |
|
25 | string $text, |
||
26 | 27 | Location $location = null, |
|
27 | 27 | Attachment $attachment = null, |
|
28 | 27 | string $data = null, |
|
29 | 27 | $raw = null |
|
30 | 27 | ) { |
|
31 | 27 | $this->chat = $chat; |
|
32 | 27 | $this->from = $from; |
|
33 | 27 | $this->text = $text; |
|
34 | $this->location = $location; |
||
35 | $this->attachment = $attachment; |
||
36 | $this->data = $data; |
||
37 | $this->raw = $raw; |
||
38 | } |
||
39 | |||
40 | public function getChat(): Chat |
||
41 | { |
||
42 | return $this->chat; |
||
43 | } |
||
44 | |||
45 | 15 | public function getFrom(): User |
|
46 | { |
||
47 | 15 | return $this->from; |
|
48 | } |
||
49 | |||
50 | public function getText(): string |
||
51 | { |
||
52 | return $this->text; |
||
53 | } |
||
54 | |||
55 | 10 | public function getLocation(): Location |
|
56 | { |
||
57 | 10 | return $this->location; |
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
58 | } |
||
59 | |||
60 | 2 | public function getAttachment(): ?Attachment |
|
61 | { |
||
62 | 2 | return $this->attachment; |
|
63 | } |
||
64 | |||
65 | public function getData(): ?string |
||
66 | { |
||
67 | return $this->data; |
||
68 | } |
||
69 | |||
70 | public function getRaw() |
||
71 | { |
||
72 | return $this->raw; |
||
73 | } |
||
74 | } |
||
75 |