1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
|
4
|
|
|
namespace Sysbot\Telegram\Constants; |
5
|
|
|
|
6
|
|
|
|
7
|
|
|
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer; |
8
|
|
|
use Sysbot\Telegram\API; |
9
|
|
|
use Sysbot\Telegram\Types\Animation; |
10
|
|
|
use Sysbot\Telegram\Types\Audio; |
11
|
|
|
use Sysbot\Telegram\Types\BotCommand; |
12
|
|
|
use Sysbot\Telegram\Types\CallbackQuery; |
13
|
|
|
use Sysbot\Telegram\Types\Chat; |
14
|
|
|
use Sysbot\Telegram\Types\ChatInviteLink; |
15
|
|
|
use Sysbot\Telegram\Types\ChatMemberUpdated; |
16
|
|
|
use Sysbot\Telegram\Types\ChatPermissions; |
17
|
|
|
use Sysbot\Telegram\Types\ChatPhoto; |
18
|
|
|
use Sysbot\Telegram\Types\Document; |
19
|
|
|
use Sysbot\Telegram\Types\InlineQueryResultCachedAudio; |
20
|
|
|
use Sysbot\Telegram\Types\InlineQueryResultCachedDocument; |
21
|
|
|
use Sysbot\Telegram\Types\InlineQueryResultCachedGif; |
22
|
|
|
use Sysbot\Telegram\Types\InlineQueryResultCachedMpeg4Gif; |
23
|
|
|
use Sysbot\Telegram\Types\InlineQueryResultCachedPhoto; |
24
|
|
|
use Sysbot\Telegram\Types\InlineQueryResultCachedSticker; |
25
|
|
|
use Sysbot\Telegram\Types\InlineQueryResultCachedVideo; |
26
|
|
|
use Sysbot\Telegram\Types\InlineQueryResultCachedVoice; |
27
|
|
|
use Sysbot\Telegram\Types\Message; |
28
|
|
|
use Sysbot\Telegram\Types\PassportFile; |
29
|
|
|
use Sysbot\Telegram\Types\PhotoSize; |
30
|
|
|
use Sysbot\Telegram\Types\Sticker; |
31
|
|
|
use Sysbot\Telegram\Types\User; |
32
|
|
|
use Sysbot\Telegram\Types\Video; |
33
|
|
|
use Sysbot\Telegram\Types\VideoNote; |
34
|
|
|
use Sysbot\Telegram\Types\Voice; |
35
|
|
|
|
36
|
|
|
class ApiClasses |
37
|
|
|
{ |
38
|
|
|
|
39
|
|
|
public const API_CLASSES = [ |
40
|
|
|
Animation::class, |
41
|
|
|
Audio::class, |
42
|
|
|
ChatPhoto::class, |
43
|
|
|
Document::class, |
44
|
|
|
PassportFile::class, |
45
|
|
|
PhotoSize::class, |
46
|
|
|
Sticker::class, |
47
|
|
|
Video::class, |
48
|
|
|
VideoNote::class, |
49
|
|
|
Voice::class, |
50
|
|
|
InlineQueryResultCachedAudio::class, |
51
|
|
|
InlineQueryResultCachedDocument::class, |
52
|
|
|
InlineQueryResultCachedGif::class, |
53
|
|
|
InlineQueryResultCachedMpeg4Gif::class, |
54
|
|
|
InlineQueryResultCachedPhoto::class, |
55
|
|
|
InlineQueryResultCachedSticker::class, |
56
|
|
|
InlineQueryResultCachedVideo::class, |
57
|
|
|
InlineQueryResultCachedVoice::class, |
58
|
|
|
BotCommand::class, |
59
|
|
|
CallbackQuery::class, |
60
|
|
|
Chat::class, |
61
|
|
|
ChatInviteLink::class, |
62
|
|
|
ChatMemberUpdated::class, |
63
|
|
|
ChatPermissions::class, |
64
|
|
|
Message::class, |
65
|
|
|
User::class |
66
|
|
|
]; |
67
|
|
|
|
68
|
|
|
public static function buildArgs(API $api): array |
69
|
|
|
{ |
70
|
|
|
$args = []; |
71
|
|
|
foreach (self::API_CLASSES as $apiClass) { |
72
|
|
|
$args[AbstractNormalizer::DEFAULT_CONSTRUCTOR_ARGUMENTS][$apiClass] = ['api' => $api]; |
73
|
|
|
} |
74
|
|
|
return $args; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
} |