Skip to content

Provide further variables to *all* commands. #1455

Open
@on7lds

Description

@on7lds

🎉 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions