Skip to content

Commit 6fc45b3

Browse files
committed
Handle webhookinfo action sooner to prevent running unnecessary code.
1 parent 5f8070f commit 6fc45b3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/BotManager.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ public function run(): self
124124
$this->validateSecret();
125125
$this->validateRequest();
126126

127+
if ($this->action->isAction('webhookinfo')) {
128+
$webhookinfo = Request::getWebhookInfo();
129+
print_r($webhookinfo->getResult() ?: $webhookinfo->printError());
130+
return $this;
131+
}
127132
if ($this->action->isAction(['set', 'unset', 'reset'])) {
128133
return $this->validateAndSetWebhook();
129134
}
@@ -134,9 +139,6 @@ public function run(): self
134139
$this->handleRequest();
135140
} elseif ($this->action->isAction('cron')) {
136141
$this->handleCron();
137-
} elseif ($this->action->isAction('webhookinfo')) {
138-
$webhookinfo = Request::getWebhookInfo();
139-
print_r($webhookinfo->getResult() ?: $webhookinfo->printError());
140142
}
141143

142144
return $this;

0 commit comments

Comments
 (0)