Skip to content

Commit 235fd82

Browse files
committed
Readme update
1 parent c1b0996 commit 235fd82

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ You must set [WebHook](https://core.telegram.org/bots/api#setwebhook)
100100
Create set.php and put:
101101
```php
102102
<?php
103-
104103
$loader = require __DIR__.'/vendor/autoload.php';
105104

106105
$API_KEY = 'your_bot_api_key';
@@ -109,7 +108,6 @@ $BOT_NAME = 'namebot';
109108
try {
110109
// create Telegram API object
111110
$telegram = new Longman\TelegramBot\Telegram($API_KEY, $BOT_NAME);
112-
113111
// set webhook
114112
echo $telegram->setWebHook('https://yourdomain/yourpath_to_hook.php');
115113
} catch (Longman\TelegramBot\Exception\TelegramException $e) {
@@ -122,7 +120,6 @@ And open your set.php via browser
122120
After create hook.php and put:
123121
```php
124122
<?php
125-
126123
$loader = require __DIR__.'/vendor/autoload.php';
127124

128125
$API_KEY = 'your_bot_api_key';
@@ -131,7 +128,6 @@ $BOT_NAME = 'namebot';
131128
try {
132129
// create Telegram API object
133130
$telegram = new Longman\TelegramBot\Telegram($API_KEY,$BOT_NAME);
134-
135131
// here you can set some command specified parameters, for example, google geocode/timezone api key for date command:
136132
$telegram->setCommandConfig('date', array('google_api_key'=>'your_google_api_key_here'));
137133

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

148144
```php
149145
<?php
150-
151146
$credentials = array('host'=>'localhost', 'user'=>'dbuser', 'password'=>'dbpass', 'database'=>'dbname');
152147

153148
$telegram->enableMySQL($credentials);
154-
155149
```
156150
You can set a custom prefix to all the tables while you are enabling mysql:
157151

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

174168
**GenericCommand.php** let you handle commands that non exist or use commands as var:
175-
Favourite colour? **/blac /red**
176-
Favourite number? **/1 /134 **
169+
Favourite colour? **/black /red**
170+
Favourite number? **/1 /134**
177171

178172

179173
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:

0 commit comments

Comments
 (0)