forked from teamgram/teamgram-madeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.php
24 lines (18 loc) · 850 Bytes
/
cli.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
require_once 'vendor/autoload.php';
$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();
$me = $MadelineProto->getSelf();
$MadelineProto->logger($me);
if (!$me['bot']) {
$MadelineProto->messages->sendMessage(['peer' => '@benqi', 'message' => "Hi!\nThanks for creating MadelineProto! <3"]);
// $MadelineProto->channels->joinChannel(['channel' => '@MadelineProto']);
//
// try {
// $MadelineProto->messages->importChatInvite(['hash' => 'https://t.me/joinchat/Bgrajz6K-aJKu0IpGsLpBg']);
// } catch (\danog\MadelineProto\RPCErrorException $e) {
// $MadelineProto->logger($e);
// }
// $MadelineProto->messages->sendMessage(['peer' => 'https://t.me/joinchat/Bgrajz6K-aJKu0IpGsLpBg', 'message' => 'Testing MadelineProto!']);
}
$MadelineProto->echo('OK, done!');