diff --git a/src/danog/MadelineProto/Lua.php b/src/danog/MadelineProto/Lua.php index 517eeeb1..8d7578ab 100644 --- a/src/danog/MadelineProto/Lua.php +++ b/src/danog/MadelineProto/Lua.php @@ -53,6 +53,9 @@ class Lua $methods[$namespace][$method] = [$this->MadelineProto->{$namespace}, $method]; } foreach ($this->MadelineProto->get_method_namespaces() as $namespace) { + if ($namespace === 'upload') { + continue; + } $this->{$namespace} = $methods[$namespace]; } } diff --git a/src/danog/MadelineProto/MTProtoTools/CallHandler.php b/src/danog/MadelineProto/MTProtoTools/CallHandler.php index 336fdd8d..6636c7cf 100644 --- a/src/danog/MadelineProto/MTProtoTools/CallHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/CallHandler.php @@ -43,7 +43,7 @@ trait CallHandler if (isset($args['ping_id']) && is_int($args['ping_id'])) { $args['ping_id'] = $this->pack_signed_long($args['ping_id']); } - if (isset($args['chat_id']) && !isset($args['peer']) && $method !== 'messages.discardEncryption' && (is_object($args['chat_id']) || $args['chat_id'] < 0)) { + if (isset($args['chat_id']) && !isset($args['peer']) && $method !== 'messages.discardEncryption' && (is_object($args['chat_id']) || $args['chat_id'] < 0 || !is_numeric($args['chat_id']))) { $res = $this->get_info($args['chat_id']); if ($res['type'] !== 'chat') { throw new \danog\MadelineProto\Exception('chat_id is not a chat id!');