-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.php
More file actions
37 lines (29 loc) · 839 Bytes
/
main.php
File metadata and controls
37 lines (29 loc) · 839 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
26
27
28
29
30
31
32
33
34
35
36
37
<?php declare(strict_types=1);
/*
* The project created by @wizardloop
*/
require_once __DIR__ . '/vendor/autoload.php';
use JewishPulse\JewishPulse;
$env = parse_ini_file(__DIR__ . '/src/.env');
if (!isset($env['API_ID'], $env['API_HASH'], $env['BOT_TOKEN'])) {
die("Missing environment variables in .env\n");
}
$apiId = $env['API_ID'];
$apiHash = $env['API_HASH'];
$botToken = $env['BOT_TOKEN'];
try {
$settings = new \danog\MadelineProto\Settings();
$settings->setAppInfo(
(new \danog\MadelineProto\Settings\AppInfo())
->setApiId((int) $apiId)
->setApiHash($apiHash)
);
JewishPulse::startAndLoopBot(
__DIR__ . '/src/bot.madeline',
$botToken,
$settings
);
} catch (\Throwable $e) {
echo "\nError: " . $e->getMessage() . "\n";
exit(1);
}