Skip to content

Commit

Permalink
Readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
MBoretto committed Aug 31, 2015
1 parent c1b0996 commit 235fd82
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ You must set [WebHook](https://core.telegram.org/bots/api#setwebhook)
Create set.php and put:
```php
<?php

$loader = require __DIR__.'/vendor/autoload.php';

$API_KEY = 'your_bot_api_key';
Expand All @@ -109,7 +108,6 @@ $BOT_NAME = 'namebot';
try {
// create Telegram API object
$telegram = new Longman\TelegramBot\Telegram($API_KEY, $BOT_NAME);

// set webhook
echo $telegram->setWebHook('https://yourdomain/yourpath_to_hook.php');
} catch (Longman\TelegramBot\Exception\TelegramException $e) {
Expand All @@ -122,7 +120,6 @@ And open your set.php via browser
After create hook.php and put:
```php
<?php

$loader = require __DIR__.'/vendor/autoload.php';

$API_KEY = 'your_bot_api_key';
Expand All @@ -131,7 +128,6 @@ $BOT_NAME = 'namebot';
try {
// create Telegram API object
$telegram = new Longman\TelegramBot\Telegram($API_KEY,$BOT_NAME);

// here you can set some command specified parameters, for example, google geocode/timezone api key for date command:
$telegram->setCommandConfig('date', array('google_api_key'=>'your_google_api_key_here'));

Expand All @@ -147,11 +143,9 @@ If you want insert in database messages/users for further usage in commands, cre

```php
<?php

$credentials = array('host'=>'localhost', 'user'=>'dbuser', 'password'=>'dbpass', 'database'=>'dbname');

$telegram->enableMySQL($credentials);

```
You can set a custom prefix to all the tables while you are enabling mysql:

Expand All @@ -172,8 +166,8 @@ It can execute command triggering a chat event. Here's the list:
- Left chat participant (**LeftchatparticipantCommand.php**)

**GenericCommand.php** let you handle commands that non exist or use commands as var:
Favourite colour? **/blac /red**
Favourite number? **/1 /134 **
Favourite colour? **/black /red**
Favourite number? **/1 /134**


Maybe you would like to develop your own commands. A good practice is to store them outside vendor/. This can be done adding before the method:
Expand Down

0 comments on commit 235fd82

Please sign in to comment.