Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
unreal4u authored Sep 9, 2017
2 parents d0e8a65 + 1298c99 commit 0b725cd
Show file tree
Hide file tree
Showing 28 changed files with 83 additions and 70 deletions.
18 changes: 9 additions & 9 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/00.send-message.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
include __DIR__.'/basics.php';

use \React\EventLoop\Factory;
use \unreal4u\TelegramAPI\HttpClientRequestHandlerReact;
use \unreal4u\TelegramAPI\HttpClientRequestHandler;
use \unreal4u\TelegramAPI\TgLog;
use \unreal4u\TelegramAPI\Telegram\Methods\SendMessage;

$loop = Factory::create();
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandlerReact($loop));
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandler($loop));

$sendMessage = new SendMessage();
$sendMessage->chat_id = A_USER_CHAT_ID;
Expand Down
4 changes: 2 additions & 2 deletions examples/01.blocking-get-me.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
include __DIR__.'/basics.php';

use React\EventLoop\Factory;
use \unreal4u\TelegramAPI\HttpClientRequestHandlerReact;
use \unreal4u\TelegramAPI\HttpClientRequestHandler;
use unreal4u\TelegramAPI\Telegram\Methods\GetMe;
use unreal4u\TelegramAPI\TgLog;

$loop = Factory::create();
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandlerReact($loop));
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandler($loop));

$response = Clue\React\Block\await($tgLog->performApiRequest(new GetMe()), $loop);
var_dump($response);
6 changes: 3 additions & 3 deletions examples/get-chat-member.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
include __DIR__.'/basics.php';

use React\EventLoop\Factory;
use \unreal4u\TelegramAPI\HttpClientRequestHandlerReact;
use \unreal4u\TelegramAPI\HttpClientRequestHandler;
use unreal4u\TelegramAPI\Telegram\Methods\GetChatMember;
use unreal4u\TelegramAPI\TgLog;

$loop = Factory::create();
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandlerReact($loop));
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandler($loop));

$getChatMember = new GetChatMember();
$getChatMember->chat_id = A_GROUP_CHAT_ID;
Expand All @@ -25,7 +25,7 @@ function ($response) {
},
function (\Exception $exception) {
// Onoes, an exception occurred...
echo 'Exception ' . get_class($exception) . ' caught, message: ' . $exception->getMessage();
echo 'Exception ' . get_class($exception) . ' caught, message: ' . $exception->getMessage().PHP_EOL;
}
);

Expand Down
4 changes: 2 additions & 2 deletions examples/get-chat-members-count.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

use React\EventLoop\Factory;
use unreal4u\TelegramAPI\Exceptions\ClientException;
use unreal4u\TelegramAPI\HttpClientRequestHandlerReact;
use unreal4u\TelegramAPI\HttpClientRequestHandler;
use unreal4u\TelegramAPI\Telegram\Methods\GetChatMembersCount;
use unreal4u\TelegramAPI\TgLog;
use unreal4u\TelegramAPI\Telegram\Types\Custom\ResultInt;

$loop = Factory::create();
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandlerReact($loop));
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandler($loop));

$getCMC = new GetChatMembersCount();
$getCMC->chat_id = A_GROUP_CHAT_ID;
Expand Down
4 changes: 2 additions & 2 deletions examples/get-file.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
include __DIR__.'/basics.php';

use React\EventLoop\Factory;
use unreal4u\TelegramAPI\HttpClientRequestHandlerReact;
use unreal4u\TelegramAPI\HttpClientRequestHandler;
use unreal4u\TelegramAPI\InternalFunctionality\TelegramDocument;
use unreal4u\TelegramAPI\Telegram\Methods\GetFile;
use unreal4u\TelegramAPI\Telegram\Types\File;
use unreal4u\TelegramAPI\TgLog;

$loop = Factory::create();
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandlerReact($loop));
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandler($loop));

$getFile = new GetFile();
// You can get a file id from an update, webhook or any other message object
Expand Down
4 changes: 2 additions & 2 deletions examples/get-me.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
include __DIR__.'/basics.php';

use React\EventLoop\Factory;
use unreal4u\TelegramAPI\HttpClientRequestHandlerReact;
use unreal4u\TelegramAPI\HttpClientRequestHandler;
use unreal4u\TelegramAPI\Telegram\Methods\GetMe;
use unreal4u\TelegramAPI\TgLog;
use \unreal4u\TelegramAPI\Abstracts\TelegramTypes;

$loop = Factory::create();
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandlerReact($loop));
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandler($loop));

$getMePromise = $tgLog->performApiRequest(new GetMe());
$getMePromise->then(
Expand Down
4 changes: 2 additions & 2 deletions examples/get-updates.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
include __DIR__.'/basics.php';

use React\EventLoop\Factory;
use \unreal4u\TelegramAPI\HttpClientRequestHandlerReact;
use \unreal4u\TelegramAPI\HttpClientRequestHandler;
use unreal4u\TelegramAPI\Telegram\Methods\GetUpdates;
use \unreal4u\TelegramAPI\Abstracts\TraversableCustomType;
use unreal4u\TelegramAPI\TgLog;

$loop = Factory::create();
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandlerReact($loop));
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandler($loop));

$getUpdates = new GetUpdates();

Expand Down
4 changes: 2 additions & 2 deletions examples/get-user-profile-photos.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
include __DIR__.'/basics.php';

use React\EventLoop\Factory;
use unreal4u\TelegramAPI\HttpClientRequestHandlerReact;
use unreal4u\TelegramAPI\HttpClientRequestHandler;
use unreal4u\TelegramAPI\Telegram\Methods\GetUserProfilePhotos;
use unreal4u\TelegramAPI\TgLog;

$loop = Factory::create();
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandlerReact($loop));
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandler($loop));

$userProfilePhotos = new GetUserProfilePhotos();
$userProfilePhotos->user_id = A_USER_ID;
Expand Down
4 changes: 2 additions & 2 deletions examples/get-webhookinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
include __DIR__ . '/basics.php';

use React\EventLoop\Factory;
use unreal4u\TelegramAPI\HttpClientRequestHandlerReact;
use unreal4u\TelegramAPI\HttpClientRequestHandler;
use unreal4u\TelegramAPI\Telegram\Methods\GetWebhookInfo;
use unreal4u\TelegramAPI\Telegram\Types\WebhookInfo;
use unreal4u\TelegramAPI\TgLog;

$loop = Factory::create();
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandlerReact($loop));
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandler($loop));

$webHookInfo = new GetWebhookInfo();
$promise = $tgLog->performApiRequest($webHookInfo);
Expand Down
4 changes: 2 additions & 2 deletions examples/send-audio.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
include __DIR__.'/basics.php';

use React\EventLoop\Factory;
use unreal4u\TelegramAPI\HttpClientRequestHandlerReact;
use unreal4u\TelegramAPI\HttpClientRequestHandler;
use unreal4u\TelegramAPI\Telegram\Methods\SendAudio;
use unreal4u\TelegramAPI\Telegram\Types\Custom\InputFile;
use unreal4u\TelegramAPI\TgLog;

$loop = Factory::create();
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandlerReact($loop));
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandler($loop));

$sendAudio = new SendAudio();
$sendAudio->chat_id = A_USER_CHAT_ID;
Expand Down
4 changes: 2 additions & 2 deletions examples/send-chat-action.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
include __DIR__.'/basics.php';

use React\EventLoop\Factory;
use unreal4u\TelegramAPI\HttpClientRequestHandlerReact;
use unreal4u\TelegramAPI\HttpClientRequestHandler;
use unreal4u\TelegramAPI\Telegram\Methods\SendChatAction;
use unreal4u\TelegramAPI\Telegram\Methods\SendMessage;
use unreal4u\TelegramAPI\TgLog;

$loop = Factory::create();
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandlerReact($loop));
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandler($loop));

$sendMessage = new SendMessage();
$sendMessage->chat_id = A_USER_CHAT_ID;
Expand Down
4 changes: 2 additions & 2 deletions examples/send-document.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
include __DIR__.'/basics.php';

use React\EventLoop\Factory;
use unreal4u\TelegramAPI\HttpClientRequestHandlerReact;
use unreal4u\TelegramAPI\HttpClientRequestHandler;
use unreal4u\TelegramAPI\Telegram\Methods\SendDocument;
use unreal4u\TelegramAPI\Telegram\Types\Custom\InputFile;
use unreal4u\TelegramAPI\TgLog;

$loop = Factory::create();
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandlerReact($loop));
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandler($loop));

$sendDocument = new SendDocument();
$sendDocument->chat_id = A_USER_CHAT_ID;
Expand Down
4 changes: 2 additions & 2 deletions examples/send-invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
include __DIR__.'/basics.php';

use React\EventLoop\Factory;
use unreal4u\TelegramAPI\HttpClientRequestHandlerReact;
use unreal4u\TelegramAPI\HttpClientRequestHandler;
use unreal4u\TelegramAPI\Telegram\Methods\SendInvoice;
use unreal4u\TelegramAPI\Telegram\Types\LabeledPrice;
use unreal4u\TelegramAPI\TgLog;

$loop = Factory::create();
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandlerReact($loop));
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandler($loop));

$sendInvoice = new SendInvoice();
$sendInvoice->chat_id = A_USER_CHAT_ID;
Expand Down
4 changes: 2 additions & 2 deletions examples/send-location.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
include __DIR__.'/basics.php';

use React\EventLoop\Factory;
use unreal4u\TelegramAPI\HttpClientRequestHandlerReact;
use unreal4u\TelegramAPI\HttpClientRequestHandler;
use unreal4u\TelegramAPI\Telegram\Methods\SendLocation;
use unreal4u\TelegramAPI\TgLog;

$loop = Factory::create();
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandlerReact($loop));
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandler($loop));

$location = new SendLocation();
$location->chat_id = A_USER_CHAT_ID;
Expand Down
4 changes: 2 additions & 2 deletions examples/send-message-and-edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
include __DIR__.'/basics.php';

use React\EventLoop\Factory;
use unreal4u\TelegramAPI\HttpClientRequestHandlerReact;
use unreal4u\TelegramAPI\HttpClientRequestHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
use unreal4u\TelegramAPI\Telegram\Methods\EditMessageText;
Expand All @@ -17,7 +17,7 @@
$logger->pushHandler(new StreamHandler('logs/custom-example.log'));

$loop = Factory::create();
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandlerReact($loop), $logger);
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandler($loop), $logger);
$sendMessage = new SendMessage();
$sendMessage->chat_id = A_USER_CHAT_ID;
$sendMessage->text = 'Hello world, this is a test';
Expand Down
4 changes: 2 additions & 2 deletions examples/send-message-with-inlinekeyboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
include __DIR__.'/basics.php';

use React\EventLoop\Factory;
use unreal4u\TelegramAPI\HttpClientRequestHandlerReact;
use unreal4u\TelegramAPI\HttpClientRequestHandler;
use unreal4u\TelegramAPI\Telegram\Methods\SendMessage;
use unreal4u\TelegramAPI\Telegram\Types\Inline\Keyboard\Markup;
use unreal4u\TelegramAPI\TgLog;

$loop = Factory::create();
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandlerReact($loop));
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandler($loop));

$sendMessage = new SendMessage();
$sendMessage->chat_id = A_USER_CHAT_ID;
Expand Down
4 changes: 2 additions & 2 deletions examples/send-message-with-keyboard-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
include __DIR__.'/basics.php';

use React\EventLoop\Factory;
use unreal4u\TelegramAPI\HttpClientRequestHandlerReact;
use unreal4u\TelegramAPI\HttpClientRequestHandler;
use unreal4u\TelegramAPI\Telegram\Methods\SendMessage;
use unreal4u\TelegramAPI\Telegram\Types\KeyboardButton;
use unreal4u\TelegramAPI\Telegram\Types\ReplyKeyboardMarkup;
use unreal4u\TelegramAPI\TgLog;

$loop = Factory::create();
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandlerReact($loop));
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandler($loop));

$sendMessage = new SendMessage();
$sendMessage->chat_id = A_USER_CHAT_ID;
Expand Down
4 changes: 2 additions & 2 deletions examples/send-message.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
include __DIR__.'/basics.php';

use React\EventLoop\Factory;
use unreal4u\TelegramAPI\HttpClientRequestHandlerReact;
use unreal4u\TelegramAPI\HttpClientRequestHandler;
use unreal4u\TelegramAPI\Telegram\Methods\SendMessage;
use unreal4u\TelegramAPI\TgLog;

$loop = Factory::create();
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandlerReact($loop));
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandler($loop));

$sendMessage = new SendMessage();
$sendMessage->chat_id = A_USER_CHAT_ID;
Expand Down
4 changes: 2 additions & 2 deletions examples/send-photo.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
include __DIR__.'/basics.php';

use React\EventLoop\Factory;
use unreal4u\TelegramAPI\HttpClientRequestHandlerReact;
use unreal4u\TelegramAPI\HttpClientRequestHandler;
use unreal4u\TelegramAPI\Telegram\Methods\SendPhoto;
use unreal4u\TelegramAPI\Telegram\Types\Custom\InputFile;
use unreal4u\TelegramAPI\TgLog;

$loop = Factory::create();
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandlerReact($loop));
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandler($loop));

$sendPhoto = new SendPhoto();
$sendPhoto->chat_id = A_USER_CHAT_ID;
Expand Down
4 changes: 2 additions & 2 deletions examples/send-sticker.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
include __DIR__.'/basics.php';

use React\EventLoop\Factory;
use unreal4u\TelegramAPI\HttpClientRequestHandlerReact;
use unreal4u\TelegramAPI\HttpClientRequestHandler;
use unreal4u\TelegramAPI\Telegram\Methods\SendSticker;
use unreal4u\TelegramAPI\TgLog;

$loop = Factory::create();
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandlerReact($loop));
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandler($loop));

$sendSticker = new SendSticker();
$sendSticker->chat_id = A_USER_CHAT_ID;
Expand Down
4 changes: 2 additions & 2 deletions examples/send-video.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
include __DIR__.'/basics.php';

use React\EventLoop\Factory;
use unreal4u\TelegramAPI\HttpClientRequestHandlerReact;
use unreal4u\TelegramAPI\HttpClientRequestHandler;
use unreal4u\TelegramAPI\Telegram\Methods\SendChatAction;
use unreal4u\TelegramAPI\Telegram\Methods\SendVideo;
use unreal4u\TelegramAPI\Telegram\Types\Custom\InputFile;
use unreal4u\TelegramAPI\TgLog;

$loop = Factory::create();
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandlerReact($loop));
$tgLog = new TgLog(BOT_TOKEN, new HttpClientRequestHandler($loop));

// Let the user know we are doing some intensive stuff
$sendChatAction = new SendChatAction();
Expand Down
Loading

0 comments on commit 0b725cd

Please sign in to comment.