Commit b2ec9768 authored by Jack'lul's avatar Jack'lul

Add getBotId()

parent f536baed
...@@ -46,6 +46,13 @@ class Telegram ...@@ -46,6 +46,13 @@ class Telegram
*/ */
protected $bot_name = ''; protected $bot_name = '';
/**
* Telegram Bot id
*
* @var string
*/
protected $bot_id = '';
/** /**
* Raw request data (json) for webhook methods * Raw request data (json) for webhook methods
* *
...@@ -144,6 +151,9 @@ class Telegram ...@@ -144,6 +151,9 @@ class Telegram
$this->api_key = $api_key; $this->api_key = $api_key;
$this->bot_name = $bot_name; $this->bot_name = $bot_name;
preg_match("/([0-9]*)\:.*/", $this->api_key, $matches);
$this->bot_id = $matches[1];
//Set default download and upload path //Set default download and upload path
$this->setDownloadPath(BASE_PATH . '/../Download'); $this->setDownloadPath(BASE_PATH . '/../Download');
$this->setUploadPath(BASE_PATH . '/../Upload'); $this->setUploadPath(BASE_PATH . '/../Upload');
...@@ -728,6 +738,16 @@ class Telegram ...@@ -728,6 +738,16 @@ class Telegram
return $this->bot_name; return $this->bot_name;
} }
/**
* Get Bot Id
*
* @return string
*/
public function getBotId()
{
return $this->bot_id;
}
/** /**
* Get Version * Get Version
* *
......
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