no message
This commit is contained in:
parent
7ee6c7c885
commit
40b9666819
@ -23,8 +23,8 @@ final class HookController
|
|||||||
|
|
||||||
$sUpdate = file_get_contents("php://input");
|
$sUpdate = file_get_contents("php://input");
|
||||||
$aUpdate = json_decode($sUpdate, true);
|
$aUpdate = json_decode($sUpdate, true);
|
||||||
$aUpdate["message"]["text"] = $aUpdate["message"]["text"] ?? "没有text";
|
$sText = $aUpdate["message"]["text"] ?? "没有text";
|
||||||
if (!str_starts_with($aUpdate["message"]["text"], '/')) {
|
if (!str_starts_with($sText, '/')) {
|
||||||
// $this->sCustomCmd = "article";
|
// $this->sCustomCmd = "article";
|
||||||
// $this->sCustomFunc = "cache";
|
// $this->sCustomFunc = "cache";
|
||||||
// $this->aCustomOption[1] = "ffq";
|
// $this->aCustomOption[1] = "ffq";
|
||||||
@ -68,15 +68,15 @@ final class HookController
|
|||||||
$aData['chatId'] = (string) $aUpdate["message"]["chat"]["id"];
|
$aData['chatId'] = (string) $aUpdate["message"]["chat"]["id"];
|
||||||
$aData['fromId'] = (string) $aUpdate["message"]["from"]["id"];
|
$aData['fromId'] = (string) $aUpdate["message"]["from"]["id"];
|
||||||
|
|
||||||
|
if ($this->sCustomText) {
|
||||||
|
$aUpdate["message"]["text"] = $this->sCustomText;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($aUpdate["message"]["text"])) {
|
if (!isset($aUpdate["message"]["text"])) {
|
||||||
throw new \Exception(json_encode($aUpdate));
|
throw new \Exception(json_encode($aUpdate));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->sCustomText) {
|
$sText = $aUpdate["message"]["text"];
|
||||||
$sText = $this->sCustomText;
|
|
||||||
} else {
|
|
||||||
$sText = $aUpdate["message"]["text"] ?? "没有text";
|
|
||||||
}
|
|
||||||
|
|
||||||
// hook优先
|
// hook优先
|
||||||
// 非is_hook,并且,首字符非/
|
// 非is_hook,并且,首字符非/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user