Add getBotName method to entity, to facilitate retrieval.

parent 5fab2c79
......@@ -21,7 +21,8 @@ use ReflectionObject;
*
* @link https://core.telegram.org/bots/api#available-types
*
* @method array getRawData() Get the raw data passed to this entity
* @method array getRawData() Get the raw data passed to this entity
* @method string getBotName() Return the bot name passed to this entity
*/
abstract class Entity
{
......
......@@ -182,7 +182,7 @@ class Message extends Entity
$split_cmd = explode('@', $cmd);
if (isset($split_cmd[1])) {
//command is followed by name check if is addressed to me
if (strtolower($split_cmd[1]) === strtolower($this->bot_name)) {
if (strtolower($split_cmd[1]) === strtolower($this->getBotName())) {
return $split_cmd[0];
}
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment