mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-27 01:14:39 +01:00
Fixed more bugs
This commit is contained in:
parent
bb15d89124
commit
40f7548624
3
bot.php
3
bot.php
@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
require 'vendor/autoload.php';
|
||||
@ -31,7 +32,7 @@ while (true) {
|
||||
$MadelineProto->messages->sendMessage(['peer' => '@danogentili', 'message' => $e->getCode().': '.$e->getMessage().PHP_EOL.$e->getTraceAsString()]);
|
||||
}
|
||||
try {
|
||||
if (isset($update['update']['message']['media'])) {
|
||||
if (isset($update['update']['message']['media']) && $update['update']['message']['media'] == 'messageMediaPhoto' && $update['update']['message']['media'] == 'messageMediaDocument') {
|
||||
$time = time();
|
||||
$file = $MadelineProto->download_to_dir($update['update']['message']['media'], '/tmp');
|
||||
$MadelineProto->messages->sendMessage(['peer' => $update['update']['message']['from_id'], 'message' => 'Downloaded to '.$file.' in '.(time() - $time).' seconds', 'reply_to_msg_id' => $update['update']['message']['id'], 'entities' => [['_' => 'messageEntityPre', 'offset' => 0, 'length' => strlen($res), 'language' => 'json']]]);
|
||||
|
@ -498,7 +498,7 @@ trait FilesHandler
|
||||
return $res;
|
||||
|
||||
default:
|
||||
throw \danog\MadelineProto\Exception('Invalid constructor provided: '.$message_media['_']);
|
||||
throw new \danog\MadelineProto\Exception('Invalid constructor provided: '.$message_media['_']);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user