♻️ Move validation to Request

This commit is contained in:
2024-08-07 17:51:07 +02:00
parent e25502f4f8
commit 06a8be0583
3 changed files with 16 additions and 21 deletions

View File

@@ -21,14 +21,6 @@ class Bot
$this->config = $config;
}
public function isRequestValid(): bool
{
return hash_equals(
hash_hmac('sha256', $this->request->nc_random . $this->request->body, $this->config['secret']),
strtolower($this->request->nc_signature)
);
}
/**
* @param string $pattern the pattern to listen for
* @param \Closure|string $callback the callback to execute. Either a closure or a Class@method notation