Core: Get Value Form Command

Created on 6 Oct 2016  路  3Comments  路  Source: php-telegram-bot/core

How can I get value with a command , like :
/download_1234
I want to catch download and 1234 as data .

thanks in advance

Most helpful comment

He probably wants it to be clickable by the user.

Check GenericCommand.php, check $command = $message->getCommand(); if it contains 'command_' if yes redirect it to download command return $this->telegram->executeCommand('download');
in download command $command = $message->getCommand(); then explode() it by '_', second value in array will be your '1234' id.

All 3 comments

Why not to use command with parameter like /download 1234 ?

He probably wants it to be clickable by the user.

Check GenericCommand.php, check $command = $message->getCommand(); if it contains 'command_' if yes redirect it to download command return $this->telegram->executeCommand('download');
in download command $command = $message->getCommand(); then explode() it by '_', second value in array will be your '1234' id.

@mellat I assume we can close here, yes?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

abbe-cipher picture abbe-cipher  路  4Comments

mithek picture mithek  路  4Comments

NabiKAZ picture NabiKAZ  路  4Comments

tchibomann picture tchibomann  路  3Comments

Zoha picture Zoha  路  3Comments