-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathcron.php
38 lines (31 loc) · 1.01 KB
/
cron.php
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
<?php
/**
* This file is part of the PHP Telegram Support Bot.
*
* (c) PHP Telegram Bot Team (https://github.com/php-telegram-bot)
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace TelegramBot\SupportBot;
use Dotenv\Dotenv;
use Longman\TelegramBot\Telegram;
use Longman\TelegramBot\TelegramLog;
// Composer autoloader.
require_once __DIR__ . '/vendor/autoload.php';
Dotenv::createUnsafeImmutable(__DIR__)->load();
try {
$telegram = new Telegram(getenv('TG_API_KEY'), getenv('TG_BOT_USERNAME'));
$telegram->enableMySql([
'host' => getenv('TG_DB_HOST'),
'port' => getenv('TG_DB_PORT'),
'user' => getenv('TG_DB_USER'),
'password' => getenv('TG_DB_PASSWORD'),
'database' => getenv('TG_DB_DATABASE'),
]);
// Handle expired activations.
Helpers::handleExpiredActivations();
} catch (\Throwable $e) {
TelegramLog::error($e->getMessage());
}