Skip to content

Commit

Permalink
Merge pull request #5 from MBoretto/master
Browse files Browse the repository at this point in the history
Now the bot handle command llike /command@botname
  • Loading branch information
akalongman committed Jul 6, 2015
2 parents 3a579ea + 5f3d7fa commit 9bc25ee
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 1,337 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,13 @@ Create set.php and put:
$loader = require __DIR__.'/vendor/autoload.php';

$API_KEY = 'your_bot_api_key';
$BOT_NAME = 'namebot';

// create Telegram API object
$telegram = new Longman\TelegramBot\Telegram($API_KEY);
$telegram = new Longman\TelegramBot\Telegram($API_KEY,$BOT_NAME);

// set webhook
$telegram->setWebHook('https://yourdomain/yourpath_to_hook.php');
echo $telegram->setWebHook('https://yourdomain/yourpath_to_hook.php');

```

Expand All @@ -104,9 +105,9 @@ After create hook.php and put:
$loader = require __DIR__.'/vendor/autoload.php';

$API_KEY = 'your_bot_api_key';

$BOT_NAME = 'namebot';
// create Telegram API object
$telegram = new Longman\TelegramBot\Telegram($API_KEY);
$telegram = new Longman\TelegramBot\Telegram($API_KEY,$BOT_NAME);

// handle telegram webhook request
$telegram->handle();
Expand Down Expand Up @@ -136,4 +137,4 @@ If you like living on the edge, please report any bugs you find on the [PHP Tele
Created by [Avtandil Kikabidze][1].

[0]: https://github.com/akalongman/php-telegram-bot
[1]: mailto:akalongman@gmail.com
[1]: mailto:akalongman@gmail.com
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"require": {
"php": ">=5.3.0",
"ext-pdo": "*",
"hoa/math": "~0.0"
"hoa/math":"~0.0"

},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit 9bc25ee

Please sign in to comment.