-
Notifications
You must be signed in to change notification settings - Fork 8
/
init.php
31 lines (31 loc) · 964 Bytes
/
init.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
<?php
foreach (glob("./functions/*.php") as $filename) {
include $filename;
}
$config = json_decode(file_get_contents('config.json'));
if ($config->logging->deleteLogOnStart) {
unlink("MadelineProto.log");
unlink("debug.txt");
logger("Deleted log files",4);
}
logger("Loading config file");
logger($config,5);
logger("Refreshing commands config.json files");
$_PLUGINCONFIG = [];
refresh();
if (!file_exists('madeline.php')) {
logger("madeline.php is not downloaded, downloading");
copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
logger("Downloaded madeline.php");
}
logger('Starting MadelineProto');
include 'madeline.php';
logger('Logging in');
$settings['logger']['logger'] = \danog\MadelineProto\Logger::FILE_LOGGER;
$MadelineProto = new \danog\MadelineProto\API('userbot.php.session');
$MadelineProto->settings = $settings;
$MadelineProto->async(false);
$MadelineProto->start();
$global = [
"count" => 0
];