update to v2.0.0-b4 version

change global.php config load time and logic
set context get server function available more time
delete unused comment and @CQAPISend
@CQCommand add start_with and end_with
set exceptions extended by ZMException
rename @SwooleSetup to @ZMSetup
fix quotes for global.php
fix LightCache empty presistence_path error
remove RemoteShell
This commit is contained in:
crazywhalecc
2020-12-10 16:37:04 +08:00
parent 944a9e849b
commit 1ffb30a471
21 changed files with 110 additions and 381 deletions

View File

@@ -88,7 +88,13 @@ class QQBot
if(($word[0] != "" && $v->match == $word[0]) || in_array($word[0], $v->alias)) {
ctx()->setCache("match", $word);
return true;
} elseif ($v->pattern != "") {
} elseif ($v->start_with != "" && mb_strpos(ctx()->getMessage(), $v->start_with) === 0) {
ctx()->setCache("match", [mb_substr(ctx()->getMessage(), mb_strlen($v->start_with))]);
return true;
} elseif ($v->end_with != "" && strlen(ctx()->getMessage()) == (strripos(ctx()->getMessage(), $v->end_with) + strlen($v->end_with))) {
ctx()->setCache("match", [substr(ctx()->getMessage(), 0, strripos(ctx()->getMessage(), $v->end_with))]);
return true;
}elseif ($v->pattern != "") {
$match = matchArgs($v->pattern, ctx()->getMessage());
if($match !== false) {
ctx()->setCache("match", $match);