1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
|
4
|
|
|
namespace TelegramBot\Traits; |
5
|
|
|
|
6
|
|
|
use TelegramBot\Entities\CallbackQuery; |
7
|
|
|
use TelegramBot\Entities\ChannelPost; |
8
|
|
|
use TelegramBot\Entities\ChosenInlineResult; |
9
|
|
|
use TelegramBot\Entities\EditedChannelPost; |
10
|
|
|
use TelegramBot\Entities\EditedMessage; |
11
|
|
|
use TelegramBot\Entities\InlineQuery; |
12
|
|
|
use TelegramBot\Entities\Message; |
13
|
|
|
use TelegramBot\Entities\Payments\PreCheckoutQuery; |
14
|
|
|
use TelegramBot\Entities\Payments\ShippingQuery; |
15
|
|
|
use TelegramBot\Entities\Poll; |
16
|
|
|
use TelegramBot\Entities\PollAnswer; |
17
|
|
|
use TelegramBot\Entities\Update; |
18
|
|
|
use TelegramBot\Entities\WebAppData; |
19
|
|
|
|
20
|
|
|
trait PluginEventsTrait |
21
|
|
|
{ |
22
|
|
|
|
23
|
|
|
public function onUpdate(Update $update): \Generator |
|
|
|
|
24
|
|
|
{ |
25
|
|
|
return yield; |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
public function onMessage(int $update_id, Message $message): \Generator |
|
|
|
|
29
|
|
|
{ |
30
|
|
|
return yield; |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
public function onEditedMessage(int $update_id, EditedMessage $editedMessage): \Generator |
|
|
|
|
34
|
|
|
{ |
35
|
|
|
return yield; |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
public function onChannelPost(int $update_id, ChannelPost $channelPost): \Generator |
|
|
|
|
39
|
|
|
{ |
40
|
|
|
return yield; |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
public function onEditedChannelPost(int $update_id, EditedChannelPost $editedChannelPost): \Generator |
|
|
|
|
44
|
|
|
{ |
45
|
|
|
return yield; |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
public function onInlineQuery(int $update_id, InlineQuery $inlineQuery): \Generator |
|
|
|
|
49
|
|
|
{ |
50
|
|
|
return yield; |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
public function onChosenInlineResult(int $update_id, ChosenInlineResult $chosenInlineResult): \Generator |
|
|
|
|
54
|
|
|
{ |
55
|
|
|
return yield; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
public function onCallbackQuery(int $update_id, CallbackQuery $callbackQuery): \Generator |
|
|
|
|
59
|
|
|
{ |
60
|
|
|
return yield; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
public function onShippingQuery(int $update_id, ShippingQuery $shippingQuery): \Generator |
|
|
|
|
64
|
|
|
{ |
65
|
|
|
return yield; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
public function onPreCheckoutQuery(int $update_id, PreCheckoutQuery $preCheckoutQuery): \Generator |
|
|
|
|
69
|
|
|
{ |
70
|
|
|
return yield; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
public function onPoll(int $update_id, Poll $poll): \Generator |
|
|
|
|
74
|
|
|
{ |
75
|
|
|
return yield; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
public function onPollAnswer(int $update_id, PollAnswer $pollAnswer): \Generator |
|
|
|
|
79
|
|
|
{ |
80
|
|
|
return yield; |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
public function onWebAppData(int $update_id, WebAppData $webAppData): \Generator |
|
|
|
|
84
|
|
|
{ |
85
|
|
|
return yield; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
} |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.