mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-30 10:38:59 +01:00
Fix
This commit is contained in:
parent
ed8a1c9b13
commit
cdf491fc8e
@ -10,9 +10,16 @@ abstract class AbstractButtonQuery extends AbstractQuery
|
||||
public readonly string $data;
|
||||
|
||||
/** @internal */
|
||||
|
||||
/**
|
||||
* @readonly
|
||||
* @var list<string> Regex matches, if a filter regex is present
|
||||
*
|
||||
*/
|
||||
public ?array $matches = null;
|
||||
public function __construct(MTProto $API, array $rawCallback)
|
||||
{
|
||||
parent::__construct($API, $rawCallback);
|
||||
$this->data = (string) $rawCallback['data'];
|
||||
$this->data = $rawCallback['data'];
|
||||
}
|
||||
}
|
||||
|
@ -14,12 +14,6 @@ abstract class AbstractQuery extends Update
|
||||
* @var int Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games.
|
||||
*/
|
||||
public readonly int $chatInstance;
|
||||
/**
|
||||
* @readonly
|
||||
* @var list<string> Regex matches, if a filter regex is present
|
||||
*
|
||||
*/
|
||||
public ?array $matches = null;
|
||||
|
||||
/** @internal */
|
||||
public function __construct(MTProto $API, array $rawCallback)
|
||||
|
@ -17,6 +17,6 @@ class FilterCallback extends Filter
|
||||
}
|
||||
public function apply(Update $update): bool
|
||||
{
|
||||
return $update instanceof AbstractButtonQuery && $update->data === $this->content;
|
||||
return $update instanceof AbstractButtonQuery && (string) $update->data === $this->content;
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ class FilterCallbackRegex extends Filter
|
||||
|
||||
public function apply(Update $update): bool
|
||||
{
|
||||
if ($update instanceof AbstractButtonQuery && \preg_match($this->regex, $update->data, $matches)) {
|
||||
if ($update instanceof AbstractButtonQuery && \preg_match($this->regex, (string) $update->data, $matches)) {
|
||||
$update->matches = $matches;
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user