-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.php
More file actions
26 lines (15 loc) · 699 Bytes
/
app.php
File metadata and controls
26 lines (15 loc) · 699 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
<?php
include __DIR__ . '/vendor/autoload.php';
use \danog\MadelineProto\API;
$username = readline("Welcome to MadelineProto Container \n
Please enter a Telegram username (preferrably yours):");
$api = new API('/app/session/session.madeline');
$api->async(true);
$api->loop(function() use ($api, $username){
yield $api->start();
try{
yield $api->messages->sendMessage(['peer' => $username, 'message' => 'Hello from MadelineProto Container 😎']);
}catch(\danog\MadelineProto\Exception $e){
echo "{$e->getMessage()}\n";
}
});