-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
25 lines (22 loc) · 707 Bytes
/
index.php
File metadata and controls
25 lines (22 loc) · 707 Bytes
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
<?php
$autoloads = [
'vendor/autoload.php',
dirname(dirname(__DIR__)) . '/vendor/autoload.php'
];
foreach($autoloads as $autoload) {
if(file_exists($autoload)) {
require $autoload;
break;
}
}
define('BOT_TOKEN', $_ENV['bot_token'] ?? getenv('bot_token') ?? $_SERVER['bot_token']);
define('SAFE_TOKEN', $_ENV['safe_token'] ?? getenv('safe_token') ?? $_SERVER['safe_token']);
(new \Cdro\TelegramBot2FA\Application(
\Cdro\TelegramBotCore\Client\Factory::getInstance(BOT_TOKEN),
function() {
if($_REQUEST['token'] !== SAFE_TOKEN) {
header('Location: https://www.youtube.com/watch?v=dQw4w9WgXcQ');
die;
}
})
)->runWebhook();