You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
LIERLIER
197a7949bd
|
1 year ago | |
---|---|---|
.. | ||
DateCommand.php | 1 year ago | |
README.md | 1 year ago | |
WeatherCommand.php | 1 year ago |
README.md
Config
Custom configurations can be passed to commands that support them.
This feature is mainly used to pass secrets or special values to the commands.
Adding configurations to your config
It is very easy to add configurations to config.php
:
'commands' => [
'configs' => [
'yourcommand' => ['your_config_key' => 'your_config_value'],
],
],
Alternatively, you can set them directly via code in your hook.php
:
$telegram->setCommandConfig('yourcommand', ['your_config_key' => 'your_config_value']);
Reading configurations in your command
To read any command configurations, you can fetch them from within your command like this:
$my_config = $this->getConfig('your_config_key'); // 'your_config_value'