|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace BPT\types; |
|
4
|
|
|
|
|
5
|
|
|
use BPT\telegram\telegram; |
|
6
|
|
|
use stdClass; |
|
7
|
|
|
|
|
8
|
|
|
/** |
|
9
|
|
|
* Represents a join request sent to a chat. |
|
10
|
|
|
*/ |
|
11
|
|
|
class chatJoinRequest extends types { |
|
|
|
|
|
|
12
|
|
|
/** Keep all properties which has sub properties */ |
|
13
|
|
|
private const subs = [ |
|
14
|
|
|
'chat' => 'BPT\types\chat', |
|
15
|
|
|
'from' => 'BPT\types\user', |
|
16
|
|
|
'invite_link' => 'BPT\types\chatInviteLink', |
|
17
|
|
|
]; |
|
18
|
|
|
|
|
19
|
|
|
/** Chat to which the request was sent */ |
|
20
|
|
|
public chat $chat; |
|
21
|
|
|
|
|
22
|
|
|
/** User that sent the join request */ |
|
23
|
|
|
public user $from; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* Identifier of a private chat with the user who sent the join request. This number may have more than 32 |
|
27
|
|
|
* significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it |
|
28
|
|
|
* has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this |
|
29
|
|
|
* identifier. The bot can use this identifier for 5 minutes to send messages until the join request is |
|
30
|
|
|
* processed, assuming no other administrator contacted the user. |
|
31
|
|
|
*/ |
|
32
|
|
|
public int $user_chat_id; |
|
33
|
|
|
|
|
34
|
|
|
/** Date the request was sent in Unix time */ |
|
35
|
|
|
public int $date; |
|
36
|
|
|
|
|
37
|
|
|
/** Optional. Bio of the user. */ |
|
38
|
|
|
public null|string $bio = null; |
|
39
|
|
|
|
|
40
|
|
|
/** Optional. Chat invite link that was used by the user to send the join request */ |
|
41
|
|
|
public null|chatInviteLink $invite_link = null; |
|
42
|
|
|
|
|
43
|
|
|
|
|
44
|
|
|
public function __construct(stdClass|null $object = null) { |
|
45
|
|
|
if ($object != null) { |
|
46
|
|
|
parent::__construct($object, self::subs); |
|
47
|
|
|
} |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* Accept join request |
|
52
|
|
|
* |
|
53
|
|
|
* @param null|bool $answer |
|
54
|
|
|
* |
|
55
|
|
|
* @return responseError|bool |
|
56
|
|
|
*/ |
|
57
|
|
|
public function accept(bool $answer = null): responseError|bool { |
|
58
|
|
|
return telegram::approveChatJoinRequest($this->chat->id,$this->from->id, answer: $answer); |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
/** |
|
62
|
|
|
* Decline join request |
|
63
|
|
|
* |
|
64
|
|
|
* @param bool|null $answer |
|
65
|
|
|
* |
|
66
|
|
|
* @return responseError|bool |
|
67
|
|
|
*/ |
|
68
|
|
|
public function deny(bool $answer = null): responseError|bool { |
|
69
|
|
|
return telegram::declineChatJoinRequest($this->chat->id,$this->from->id, answer: $answer); |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
/** |
|
73
|
|
|
* Revoke invite link |
|
74
|
|
|
* |
|
75
|
|
|
* @param bool|null $answer |
|
76
|
|
|
* |
|
77
|
|
|
* @return responseError|bool |
|
78
|
|
|
*/ |
|
79
|
|
|
public function revokeLink(bool $answer = null): responseError|bool { |
|
80
|
|
|
return telegram::revokeChatInviteLink($this->invite_link->invite_link, $this->chat->id, answer: $answer); |
|
81
|
|
|
} |
|
82
|
|
|
} |
|
83
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths