@@ -254,12 +254,11 @@ public function executeNoDB()
254
254
}
255
255
256
256
/**
257
- * Publish
257
+ * Publish a message to a channel and return success or failure message
258
258
*
259
- * Publish a message in a channel and retun succecs or fail message
260
- * @param Longman\TelegramBot\Entities\Message $message
261
- * @param int $channel
262
- * @param string|null $caption
259
+ * @param Entities\Message $message
260
+ * @param int $channel
261
+ * @param string|null $caption
263
262
*
264
263
* @return string
265
264
*/
@@ -271,12 +270,12 @@ protected function publish(Message $message, $channel, $caption = null)
271
270
];
272
271
273
272
if ($ this ->sendBack ($ message , $ data )->isOk ()) {
274
- $ response = 'Message sent succesfully to: ' . $ channel ;
273
+ $ response = 'Message sent successfully to: ' . $ channel ;
275
274
} else {
276
275
$ response =
277
276
'Message not sent to: ' . $ channel . "\n" .
278
- '- The channel exist? ' . "\n" .
279
- '- Is the bot admin of the channel? ' ;
277
+ '- Does the channel exist? ' . "\n" .
278
+ '- Is the bot an admin of the channel? ' ;
280
279
}
281
280
return $ response ;
282
281
}
@@ -292,10 +291,10 @@ protected function publish(Message $message, $channel, $caption = null)
292
291
* @todo This method will be moved at an higher level maybe in AdminCommand or Command
293
292
* @todo Looking for a more significative name
294
293
*
295
- * @param Longman\TelegramBot\ Entities\Message $message
296
- * @param array $data
294
+ * @param Entities\Message $message
295
+ * @param array $data
297
296
*
298
- * @return Longman\TelegramBot\ Entities\ServerResponse
297
+ * @return Entities\ServerResponse
299
298
*/
300
299
protected function sendBack (Message $ message , array $ data )
301
300
{
@@ -322,12 +321,12 @@ protected function sendBack(Message $message, array $data)
322
321
$ data ['latitude ' ] = $ message ->getLocation ()->getLatitude ();
323
322
$ data ['longitude ' ] = $ message ->getLocation ()->getLongitude ();
324
323
}
325
- $ callback_path = 'Longman\TelegramBot ' . ' \Request ' ;
326
- $ callback_function = 'send ' . $ type ;
324
+ $ callback_path = 'Longman\TelegramBot\Request ' ;
325
+ $ callback_function = 'send ' . $ type ;
327
326
if (! method_exists ($ callback_path , $ callback_function )) {
328
- throw new TelegramException ('Methods: ' . $ callback_function. ' not found in class Request. ' );
327
+ throw new TelegramException ('Methods: ' . $ callback_function . ' not found in class Request. ' );
329
328
}
330
329
331
- return call_user_func_array ($ callback_path. ':: ' . $ callback_function , array ( $ data) );
330
+ return call_user_func_array ($ callback_path . ':: ' . $ callback_function , [ $ data] );
332
331
}
333
332
}
0 commit comments