mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-12 03:05:34 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user