Skip to content

Commit

Permalink
fix sendMessage example
Browse files Browse the repository at this point in the history
  • Loading branch information
nexor committed Mar 6, 2016
1 parent 6eb3489 commit 3b969c0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/sendMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@

use Steelbot\TelegramBotApi\Api;
use Icicle\Loop;
use Steelbot\TelegramBotApi\Method\SendMessage;

$generator = function () {
$generator = function (): \Generator {
$api = new Api(getenv('BOT_TOKEN'));
$method = new SendMessage('104442434', 'Hello, world!');

$method = new \Steelbot\TelegramBotApi\Method\SendMessage('104442434', 'Hello, world!');
$message = yield from $api->send($method);
$message = yield from $api->execute($method);

echo "Message was sent:\n";
print_r($message);
Expand Down

0 comments on commit 3b969c0

Please sign in to comment.