Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

Commit

Permalink
better format
Browse files Browse the repository at this point in the history
  • Loading branch information
Peaksol committed Feb 14, 2022
1 parent 5d242a4 commit 478bec6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
10 changes: 8 additions & 2 deletions SpelakoMAHA.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,14 @@ function post($url, $content) {
if($v->type == 'GroupMessage'
&& $v->messageChain[1]->type == 'Plain'
&& $v->messageChain[1]->text[0] == '/') {
_log('Request by '.$v->sender->id.': '.$v->messageChain[1]->text);
_log(SpelakoUtils::buildString(
'群: %1$s | 用户: %2$s | 消息: %3$s',
[
$v->sender->group->id,
$v->sender->id,
$v->messageChain[1]->text
]
));
$requestResult = $core->execute($v->messageChain[1]->text, $v->sender->id);
if(!$requestResult) {
$cmd = explode(' ', $v->messageChain[1]->text)[0];
Expand All @@ -117,7 +124,6 @@ function post($url, $content) {
'text' => $requestResult
]]
]));
var_dump($sendResult);
}
}
sleep(1);
Expand Down
1 change: 1 addition & 0 deletions start.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
title SpelakoMAHA
:start
php SpelakoMAHA.php --core="../SpelakoCore/SpelakoCore.php" --config="config.json" --verify-key="inputYourKey" --host="http://127.0.0.1:8080/" --qq="123456789"
timeout /t 10 /nobreak
goto start
1 change: 1 addition & 0 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
while :
do
php SpelakoMAHA.php --core="../SpelakoCore/SpelakoCore.php" --config="config.json" --verify-key="inputYourKey" --host="http://127.0.0.1:8080/" --qq="123456789"
echo "Waiting for 10 seconds, press Ctrl+C to quit ..."; sleep 10
done

0 comments on commit 478bec6

Please sign in to comment.