blob: 592919c41e22bfed440b9ecce451dcb39f345f5d (
plain) (
blame)
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
use \NeonXP\TelegramApi\Telegram;
use \Doctrine\Common\Annotations\AnnotationRegistry;
use \NeonXP\TelegramApi\Types\Message;
use \NeonXP\TelegramApi\Types\InputFile;
use \NeonXP\TelegramApi\Script;
use \NeonXP\TelegramApi\Script\State;
use \NeonXP\TelegramApi\Script\Conditions\isText;
use \NeonXP\TelegramApi\Script\Conditions\isMatch;
use \NeonXP\TelegramApi\Script\Conditions\isAnyText;
use \NeonXP\TelegramApi\Script\Conditions\isContact;
use \NeonXP\TelegramApi\Script\Conditions\isPhoto;
use \NeonXP\TelegramApi\Script\Conditions\isSticker;
use \NeonXP\TelegramApi\Script\Conditions\isLocation;
use \NeonXP\TelegramApi\Script\Conditions\isDocument;
use \NeonXP\TelegramApi\Script\Conditions\isReply;
use \NeonXP\TelegramApi\Script\Conditions\isForward;
use \NeonXP\TelegramApi\Script\Conditions\isVideo;
use \NeonXP\TelegramApi\Script\Conditions\isVoice;
use \NeonXP\TelegramApi\Script\Conditions\isAudio;
use \NeonXP\TelegramApi\Helpers\StatusActions;
require './../vendor/autoload.php';
AnnotationRegistry::registerAutoloadNamespace(
'JMS\Serializer\Annotation',
__DIR__.'/../vendor/jms/serializer/src'
);
$cache = new \Doctrine\Common\Cache\ApcuCache();
$dozorApi = new \NeonXP\DozorApi($cache);
$telegram = new Telegram([
'token' => getenv('TELEGRAM_BOT_TOKEN')
]);
$telegram->setCache($cache);
$telegram->setScript(\NeonXP\BotScript::getScript($telegram, $dozorApi));
$telegram->handleWebhook();
|