@@ -56,20 +56,20 @@ class Telegram
56
56
*/
57
57
const CONTACT = 'contact ' ;
58
58
59
- private $ bot_id = '' ;
59
+ private $ bot_token = '' ;
60
60
private $ data = [];
61
61
private $ updates = [];
62
62
63
63
/// Class constructor
64
64
65
65
/**
66
66
* Create a Telegram instance from the bot token
67
- * \param $bot_id the bot token
67
+ * \param $bot_token the bot token
68
68
* \return an instance of the class.
69
69
*/
70
- public function __construct ($ bot_id )
70
+ public function __construct ($ bot_token )
71
71
{
72
- $ this ->bot_id = $ bot_id ;
72
+ $ this ->bot_token = $ bot_token ;
73
73
$ this ->data = $ this ->getData ();
74
74
}
75
75
@@ -84,7 +84,7 @@ public function __construct($bot_id)
84
84
*/
85
85
public function endpoint ($ api , array $ content , $ post = true )
86
86
{
87
- $ url = 'https://api.telegram.org/bot ' .$ this ->bot_id .'/ ' .$ api ;
87
+ $ url = 'https://api.telegram.org/bot ' .$ this ->bot_token .'/ ' .$ api ;
88
88
if ($ post ) {
89
89
$ reply = $ this ->sendAPIRequest ($ url , $ content );
90
90
} else {
@@ -1307,7 +1307,7 @@ public function editMessageReplyMarkup(array $content)
1307
1307
*/
1308
1308
public function downloadFile ($ telegram_file_path , $ local_file_path )
1309
1309
{
1310
- $ file_url = 'https://api.telegram.org/file/bot ' .$ this ->bot_id .'/ ' .$ telegram_file_path ;
1310
+ $ file_url = 'https://api.telegram.org/file/bot ' .$ this ->bot_token .'/ ' .$ telegram_file_path ;
1311
1311
$ in = fopen ($ file_url , 'rb ' );
1312
1312
$ out = fopen ($ local_file_path , 'wb ' );
1313
1313
0 commit comments