Add support for params in commands
Now you can format you commands with regex pattern
Example:
use Mateodioev\Bots\Telegram\Api;
use Mateodioev\TgHandler\Context;
use Mateodioev\TgHandler\Commands\MessageCommand;
class Start extends MessageCommand {
protected string $name = 'info';
protected string $params = '{w:id}';
public function handle(Api $bot, Context $context, array $args = []) {
$id = $this->param('id', 'default id'); // get the param
}
}
// This command now only works with this format: "/info myId"
Full Changelog: v3.4.04...v3.5.0