mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-30 05:58:58 +01:00
Support @s in commands
This commit is contained in:
parent
0f6e0da4a1
commit
4b45fe7612
@ -39,7 +39,7 @@ final class FilterCommand extends Filter
|
|||||||
*/
|
*/
|
||||||
public function __construct(private readonly string $command, array $types = [CommandType::BANG, CommandType::DOT, CommandType::SLASH])
|
public function __construct(private readonly string $command, array $types = [CommandType::BANG, CommandType::DOT, CommandType::SLASH])
|
||||||
{
|
{
|
||||||
Assert::true(preg_match("/^\w+$/", $command) === 1, "An invalid command was specified!");
|
Assert::true(preg_match("/^[\w@]+$/", $command) === 1, "An invalid command was specified!");
|
||||||
Assert::notEmpty($types, 'No command types were specified!');
|
Assert::notEmpty($types, 'No command types were specified!');
|
||||||
$c = [];
|
$c = [];
|
||||||
foreach ($types as $type) {
|
foreach ($types as $type) {
|
||||||
|
Loading…
Reference in New Issue
Block a user