Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Now the bot handle command llike /command@botname #5

Merged
merged 8 commits into from
Jul 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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