-
Notifications
You must be signed in to change notification settings - Fork 0
/
gc.php
51 lines (36 loc) · 1.15 KB
/
gc.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
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
include __DIR__ . '/vendor/autoload.php';
use \danog\MadelineProto\Logger;
print("Started script");
$MadelineProto = new \danog\MadelineProto\API('session/session.madeline');
$MadelineProto->start();
$info = $MadelineProto->getSelf();
print_r($info);
$sender = $MadelineProto->messages->sendMessage(['peer' => '@doctool_bot', 'message' => $argv[1]]);
//sleep(1);
Logger::log("Uploading photo...");
$media = $MadelineProto->messages->uploadMedia([
'media' => [
'_' => 'inputMediaUploadedDocument',
'file' => 'snow.jpg',
],
]
);
$update = $MadelineProto->messages->sendMedia([
'peer' => '@doctool_bot',
'media' => $media,
'message' => 'Uploaded Media'
]
);
Logger::log("Photo sent. Update: \n " . print_r($media,true));
$MadelineProto->downloadToFile($media, 'profile.jpg');
$sentUpdate = $MadelineProto->messages->sendMedia([
'peer' => '@doctool_bot',
'media' => [
'_' => 'inputMediaUploadedDocument',
'file' => 'dog.jpg'
],
'message' => 'Dog caption',
]);
Logger::log("Sent media: ". print_r($sentMedia,true));
?>