Commit 165d88f6 authored by LONGMAN's avatar LONGMAN

Fixes

parent d756b2d0
Contributing Contributing
------------- -------------
Before you contribute code to php-telegram-bot, please make sure it conforms to the PHPCS coding standard and that the php-telegram-bot unit tests still pass. The easiest way to contribute is to work on a checkout of the repository, or your own fork, rather than an installed PEAR version. If you do this, you can run the following commands to check if everything is ready to submit: Before you contribute code to php-telegram-bot, please make sure it conforms to the PSR-2 coding standard and that the php-telegram-bot unit tests still pass. The easiest way to contribute is to work on a checkout of the repository, or your own fork. If you do this, you can run the following commands to check if everything is ready to submit:
cd php-telegram-bot cd php-telegram-bot
composer update composer update
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
[![Join the chat at https://gitter.im/akalongman/php-telegram-bot](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/akalongman/php-telegram-bot?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Join the chat at https://gitter.im/akalongman/php-telegram-bot](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/akalongman/php-telegram-bot?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/akalongman/php-telegram-bot.svg?branch=master)](https://travis-ci.org/akalongman/kautilities) [![Build Status](https://travis-ci.org/akalongman/php-telegram-bot.svg?branch=master)](https://travis-ci.org/akalongman/php-telegram-bot)
[![Latest Stable Version](https://img.shields.io/packagist/v/Longman/telegram-bot.svg)](https://packagist.org/packages/longman/telegram-bot) [![Latest Stable Version](https://img.shields.io/packagist/v/Longman/telegram-bot.svg)](https://packagist.org/packages/longman/telegram-bot)
[![Total Downloads](https://img.shields.io/packagist/dt/Longman/telegram-bot.svg)](https://packagist.org/packages/longman/telegram-bot) [![Total Downloads](https://img.shields.io/packagist/dt/Longman/telegram-bot.svg)](https://packagist.org/packages/longman/telegram-bot)
[![Downloads Month](https://img.shields.io/packagist/dm/Longman/telegram-bot.svg)](https://packagist.org/packages/longman/telegram-bot) [![Downloads Month](https://img.shields.io/packagist/dm/Longman/telegram-bot.svg)](https://packagist.org/packages/longman/telegram-bot)
...@@ -106,14 +106,13 @@ $API_KEY = 'your_bot_api_key'; ...@@ -106,14 +106,13 @@ $API_KEY = 'your_bot_api_key';
$BOT_NAME = 'namebot'; $BOT_NAME = 'namebot';
try { try {
// create Telegram API object // create Telegram API object
$telegram = new Longman\TelegramBot\Telegram($API_KEY, $BOT_NAME); $telegram = new Longman\TelegramBot\Telegram($API_KEY, $BOT_NAME);
// set webhook // set webhook
echo $telegram->setWebHook('https://yourdomain/yourpath_to_hook.php'); echo $telegram->setWebHook('https://yourdomain/yourpath_to_hook.php');
} } catch (Longman\TelegramBot\Exception\TelegramException $e) {
catch (Longman\TelegramBot\Exception\TelegramException $e) { echo $e->getMessage();
echo $e->getMessage();
} }
``` ```
And open your set.php via browser And open your set.php via browser
...@@ -129,15 +128,14 @@ $API_KEY = 'your_bot_api_key'; ...@@ -129,15 +128,14 @@ $API_KEY = 'your_bot_api_key';
$BOT_NAME = 'namebot'; $BOT_NAME = 'namebot';
try { try {
// create Telegram API object // create Telegram API object
$telegram = new Longman\TelegramBot\Telegram($API_KEY,$BOT_NAME); $telegram = new Longman\TelegramBot\Telegram($API_KEY,$BOT_NAME);
// handle telegram webhook request // handle telegram webhook request
$telegram->handle(); $telegram->handle();
} } catch (Longman\TelegramBot\Exception\TelegramException $e) {
catch (Longman\TelegramBot\Exception\TelegramException $e) { // log telegram errors
// log telegram errors // echo $e->getMessage();
// echo $e->getMessage();
} }
``` ```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment