Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide further variables to *all* commands. #1455

Open
on7lds opened this issue Apr 24, 2024 · 0 comments
Open

Provide further variables to *all* commands. #1455

on7lds opened this issue Apr 24, 2024 · 0 comments

Comments

@on7lds
Copy link

on7lds commented Apr 24, 2024

🎉 Feature Request

Provide further variables to all commands by using setCommandConfig() with an empty command name

Summary

in Telegram.php one could change function getCommandConfig() f.e. as follows :

    public function getCommandConfig($command)
    {
	$config=isset($this->commands_config[$command]) ? $this->commands_config[$command] : [];
	if (isset($this->commands_config[''])) $config=array_merge($this->commands_config[''],$config);
        return $config;
    }

then, using

$telegram->setCommandConfig('', [
    'key' => 'value',
]);

it is possible to add extra variables to all commands on top of variables for a particular command.

Existing 'general' keys are replaced by (if present) keys for a particular command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant