Commit c29efe72 by HanSon

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/Collections/ContactFactory.php
2 parents 94892c7c 165a300c
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
## 环境要求 ## 环境要求
* PHP >= 7(代码中使用了一些PHP7的特性) * PHP >= 5.6
## 安装 ## 安装
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
composer require hanson/vbot composer require hanson/vbot
``` ```
2、直接下载[release](https://github.com/HanSon/vbot/files/719331/vbot.zip) 2、直接下载[release](https://github.com/HanSon/vbot/files/754871/vbot.zip)
然后执行``` php example/index.php ``` 然后执行``` php example/index.php ```
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
"pimple/pimple": "^3.0", "pimple/pimple": "^3.0",
"illuminate/support": "^5.3", "illuminate/support": "^5.3",
"nesbot/carbon": "^1.21", "nesbot/carbon": "^1.21",
"php": ">=7.0.0",
"aferrandini/phpqrcode": "^1.0", "aferrandini/phpqrcode": "^1.0",
"symfony/console": "3.*" "symfony/console": "3.*"
}, },
......
...@@ -33,7 +33,9 @@ class ContactFactory ...@@ -33,7 +33,9 @@ class ContactFactory
$this->makeContactList(); $this->makeContactList();
myself()->alias = contact()->get(myself()->username)['Alias'] ?? myself()->nickname ? : myself()->username;
$contact = contact()->get(myself()->username);
myself()->alias = isset($contact['Alias']) ? $contact['Alias'] : myself()->nickname ? : myself()->username;
$this->getBatchGroupMembers(); $this->getBatchGroupMembers();
......
...@@ -194,9 +194,11 @@ class MessageHandler ...@@ -194,9 +194,11 @@ class MessageHandler
{ {
message()->put($message->msg['MsgId'], $message); message()->put($message->msg['MsgId'], $message);
$file = fopen(System::getPath() .'message.json', 'a'); if(server()->config['debug']) {
$file = fopen(System::getPath() . 'message.json', 'a');
fwrite($file, json_encode($message) . PHP_EOL); fwrite($file, json_encode($message) . PHP_EOL);
fclose($file); fclose($file);
} }
}
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!