@@ -26,11 +26,11 @@ class ServerResponse extends Entity
2626 * ServerResponse constructor.
2727 *
2828 * @param array $data
29- * @param string $bot_name
29+ * @param string $bot_username
3030 *
3131 * @throws \Longman\TelegramBot\Exception\TelegramException
3232 */
33- public function __construct (array $ data , $ bot_name )
33+ public function __construct (array $ data , $ bot_username )
3434 {
3535 // Make sure we don't double-save the raw_data
3636 unset($ data ['raw_data ' ]);
@@ -41,13 +41,13 @@ public function __construct(array $data, $bot_name)
4141
4242 if ($ is_ok && is_array ($ result )) {
4343 if ($ this ->isAssoc ($ result )) {
44- $ data ['result ' ] = $ this ->createResultObject ($ result , $ bot_name );
44+ $ data ['result ' ] = $ this ->createResultObject ($ result , $ bot_username );
4545 } else {
46- $ data ['result ' ] = $ this ->createResultObjects ($ result , $ bot_name );
46+ $ data ['result ' ] = $ this ->createResultObjects ($ result , $ bot_username );
4747 }
4848 }
4949
50- parent ::__construct ($ data , $ bot_name );
50+ parent ::__construct ($ data , $ bot_username );
5151 }
5252
5353 /**
@@ -88,12 +88,12 @@ public function printError()
8888 * Create and return the object of the received result
8989 *
9090 * @param array $result
91- * @param string $bot_name
91+ * @param string $bot_username
9292 *
9393 * @return \Longman\TelegramBot\Entities\Chat|\Longman\TelegramBot\Entities\ChatMember|\Longman\TelegramBot\Entities\File|\Longman\TelegramBot\Entities\Message|\Longman\TelegramBot\Entities\User|\Longman\TelegramBot\Entities\UserProfilePhotos|\Longman\TelegramBot\Entities\WebhookInfo
9494 * @throws \Longman\TelegramBot\Exception\TelegramException
9595 */
96- private function createResultObject ($ result , $ bot_name )
96+ private function createResultObject ($ result , $ bot_username )
9797 {
9898 // We don't need to save the raw_data of the response object!
9999 $ result ['raw_data ' ] = null ;
@@ -115,19 +115,19 @@ private function createResultObject($result, $bot_name)
115115 }
116116
117117 //Response from sendMessage
118- return new Message ($ result , $ bot_name );
118+ return new Message ($ result , $ bot_username );
119119 }
120120
121121 /**
122122 * Create and return the objects array of the received result
123123 *
124124 * @param array $result
125- * @param string $bot_name
125+ * @param string $bot_username
126126 *
127127 * @return null|\Longman\TelegramBot\Entities\ChatMember[]|\Longman\TelegramBot\Entities\Update[]
128128 * @throws \Longman\TelegramBot\Exception\TelegramException
129129 */
130- private function createResultObjects ($ result , $ bot_name )
130+ private function createResultObjects ($ result , $ bot_username )
131131 {
132132 $ results = [];
133133 if (isset ($ result [0 ]['user ' ])) {
@@ -144,7 +144,7 @@ private function createResultObjects($result, $bot_name)
144144 // We don't need to save the raw_data of the response object!
145145 $ update ['raw_data ' ] = null ;
146146
147- $ results [] = new Update ($ update , $ bot_name );
147+ $ results [] = new Update ($ update , $ bot_username );
148148 }
149149 }
150150
0 commit comments