File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,13 @@ class Telegram
46
46
*/
47
47
protected $ bot_name = '' ;
48
48
49
+ /**
50
+ * Telegram Bot id
51
+ *
52
+ * @var string
53
+ */
54
+ protected $ bot_id = '' ;
55
+
49
56
/**
50
57
* Raw request data (json) for webhook methods
51
58
*
@@ -144,6 +151,9 @@ public function __construct($api_key, $bot_name)
144
151
$ this ->api_key = $ api_key ;
145
152
$ this ->bot_name = $ bot_name ;
146
153
154
+ preg_match ("/([0-9]*)\:.*/ " , $ this ->api_key , $ matches );
155
+ $ this ->bot_id = $ matches [1 ];
156
+
147
157
//Set default download and upload path
148
158
$ this ->setDownloadPath (BASE_PATH . '/../Download ' );
149
159
$ this ->setUploadPath (BASE_PATH . '/../Upload ' );
@@ -728,6 +738,16 @@ public function getBotName()
728
738
return $ this ->bot_name ;
729
739
}
730
740
741
+ /**
742
+ * Get Bot Id
743
+ *
744
+ * @return string
745
+ */
746
+ public function getBotId ()
747
+ {
748
+ return $ this ->bot_id ;
749
+ }
750
+
731
751
/**
732
752
* Get Version
733
753
*
You can’t perform that action at this time.
0 commit comments